I'm having difficulties trying to understand the configurations for log4net formName and textBoxName elements. I have been following an earlier question here
specifically I am trying to create a custom user control containing a textbox to act as the logger
namespace foo {
public partial class LoggingControl : UserControl, IAppender {
private ILog _logger = LogManager.GetLogger(typeof(LoggingControl));
public LoggingControl() {
InitializeComponent();
}
public ILog Logger {
get {
return _logger;
}
}
public string FormName {
get;
set;
}
public string TextBoxName {
get;
set;
}
public void DoAppend(log4net.Core.LoggingEvent loggingEvent) {
textBox.AppendText(loggingEvent.MessageObject.ToString() + Environment.NewLine);
}
public void Close() {
}
}
}
in my config I have
<log4net>
<appender name="Logger" type="foo.LoggingControl">
<formName value="MainForm"/> --- ###01
<textBoxName value="textBox"/> --- ###02
<root>
<level value="DEBUG">
<appender-ref ref="textbox">
</appender-ref>
</level>
</root>
</appender>
</log4net>
- is set to the name of the form that contains the custom control which contains the logging textbox
- is set to the name of the textbox inside the custom control.
This isn't working, what am I missing?