private void Form1_Load(object sender, EventArgs e) { XmlConfigurator.Configure(); ListBoxAppender.ConfigureListBoxAppender(listBox1); _log.Info("This is just an example of how this appender works..."); }
public static void ConfigureListBoxAppender(ListBox listBox) { var hierarchy = (Hierarchy)LogManager.GetRepository(); var appender = new ListBoxAppender(listBox); hierarchy.Root.AddAppender(appender); }