Ok, now I'm embarrassed. Thank you. Guess I shouldn't code when I'm that tired.<div><br></div><div>Jason<br><br><div class="gmail_quote">On Thu, Mar 3, 2011 at 7:56 PM, Bee-lindgren, Bert A <span dir="ltr"><<a href="mailto:bert.bee-lindgren@oit.gatech.edu">bert.bee-lindgren@oit.gatech.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:Times New Roman;font-size:12pt;color:#000000">Are you start( )'ing the appender?<br><br>
<hr><b>From: </b>"Jason Corbett" <<a href="mailto:jasoncorbett@gmail.com" target="_blank">jasoncorbett@gmail.com</a>><br><b>To: </b><a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>
<b>Sent: </b>Thursday, March 3, 2011 7:46:29 PM<br><b>Subject: </b>[logback-user] Programmatically adding appenders<div><div></div><div class="h5"><br><br>I have searched, but have been unable to find a way to do this. I need to add an appender after configuration has happened. This is because whether or not the appender is even wanted is dependent on a runtime condition. I've seen plenty of examples using the sifting appender, but I don't want to include the appender in the config file because I don't want to create a dependency on the appender being there (it's an optional component).<div>
<br></div><div>I've tried this:</div><div><div><span style="white-space:pre-wrap"> </span>LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();</div><div><span style="white-space:pre-wrap"> </span>Logger testcase_logger = lc.getLogger("test");</div>
<div><span style="white-space:pre-wrap"> </span>logAppender.setContext(testcase_logger.getLoggerContext());</div><div><span style="white-space:pre-wrap"> </span>testcase_logger.addAppender(logAppender);</div>
</div><div><br></div><div>But I never get any logging events (this is a custom log appender). Test is the base of all the loggers I want logging to this appender (I want anything with a test. at the beginning of the logger name to write to this appender).</div>
<div><br></div><div>Any ideas?</div><div><br></div><div>My custom appender extends AppenderBase<ILoggingEvent>.</div><div><br></div><div>Jason Corbett </div>
<br></div></div>_______________________________________________<br>Logback-user mailing list<br><a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br><a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</div></div><br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
<br></blockquote></div><br></div>