Are you suggesting a close method on ILogger?  We use a static logger per class.  I don&#39;t want to have to close each logger separately.  I would like a master shutoff switch that will synchronously flush all appenders so I can call it before exiting my app.  The ILoggerFactory seems like the perfect spot for this.<br>
<br><div class="gmail_quote">On Wed, Sep 29, 2010 at 10:42 AM, Chris <span dir="ltr">&lt;<a href="mailto:shef31@yahoo.com">shef31@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I think the right solution is to add a logger.close() method to slf4j. Each implementation could handle it in its own way. For logback or log4j, it would just call stop() on each of the appenders that were attached to the logger.<div class="im">
<br>
<br>
<br>
<br>
On 9/29/2010 10:23 AM, Michael Schall wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
This requires me to have access to ch.qos.logback.classic<br>
when writing code.  It does not allow me to switch loggers out without<br>
changing code.<br>
<br>
We are in the process of moving from log4j to logback.  One requirement<br>
placed on me is to be able to revert back to log4j if something &quot;goes<br>
wrong&quot;.  I was hoping that using SLF4J would give me this ability.<br>
<br>
I&#39;m trying to achieve writing code only using SLF4J and...<br>
<br>
if slf4j-log4j12-1.6.1.jar and log4j-1.2.15.jar are in my production<br>
classpath, I&#39;m logging using log4j.<br>
If log4j-over-slf4j-1.6.1.jar (for third-party<br>
logging), logback-classic-0.9.24.jar, and logback-core-0.9.24.jar are in<br>
my production classpath, I&#39;m logging using logback.<br>
<br>
So without changing code, I can switch between logging back ends.<br>
<br>
Should ILoggerFactory have a shutdown or stop method?  It could shutdown<br>
whatever logging back end I&#39;m using?<br>
<br>
For log4j it would call<br>
- org.apache.log4j.LogManager.getLoggerRepository().shutdown();<br>
For logback it would call - loggerContext.stop()<br>
<br>
Thoughts?<br>
Mike<br>
<br>
On Tue, Sep 28, 2010 at 4:02 PM, Robert Elliot &lt;<a href="mailto:rob@lidalia.org.uk" target="_blank">rob@lidalia.org.uk</a><br></div><div class="im">
&lt;mailto:<a href="mailto:rob@lidalia.org.uk" target="_blank">rob@lidalia.org.uk</a>&gt;&gt; wrote:<br>
<br>
    How about LoggerContext.stop()?  It looks as if it&#39;s designed<br>
    specifically for this purpose.  It recursively stops and detaches<br>
    all appenders, amongst other things.<br>
<br>
    (You can cast the result of LoggerFactory.getILoggerFactory() to a<br>
    LoggerContext).<br>
<br>
    On 28 Sep 2010, at 21:53, Michael Schall wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
    Great question!  I asked this on stackoverflow a while back with no<br>
    real answers...<br>
<br>
    <a href="http://stackoverflow.com/questions/3678755/do-i-need-to-flush-events-when-shutting-down-using-logback" target="_blank">http://stackoverflow.com/questions/3678755/do-i-need-to-flush-events-when-shutting-down-using-logback</a><br>

<br>
    On Tue, Sep 28, 2010 at 3:32 PM, Chris<br>
    &lt;<a href="mailto:shef31@yahoo.com" target="_blank">shef31@yahoo.com</a><br></div><div class="im">
    &lt;mailto:<a href="mailto:shef31@yahoo.com" target="_blank">shef31@yahoo.com</a>&gt;&gt; wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
    I&#39;m using file appenders. At a certain point in my app, a little<br>
    before<br>
    shutdown, I have to close all loggers.<br>
<br>
    How do I tell logback to call stop() on all appenders?<br>
<br>
    _______________________________________________<br>
    Logback-user mailing list<br>
    <a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br></div>
    &lt;mailto:<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a>&gt;<div class="im"><br>
    <a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
<br>
</div></blockquote><div class="im">
    _______________________________________________<br>
    Logback-user mailing list<br>
    <a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br></div>
    &lt;mailto:<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a>&gt;<div class="im"><br>
    <a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</div></blockquote><div class="im">
<br>
<br>
    _______________________________________________<br>
    Logback-user mailing list<br>
    <a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br></div>
    &lt;mailto:<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a>&gt;<div class="im"><br>
    <a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<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></blockquote><div><div></div><div class="h5">
<br>
<br>
_______________________________________________<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></blockquote></div><br>