The default OnConsoleStatusListener doesn't have filtering, however you could create your own StatusListener that does, so that it only outputs/logs the ones coming from your appender.<div><br></div><div>-- TJ<br><br><div class="gmail_quote">
On Wed, Nov 16, 2011 at 11:45 AM, Steve Cohen <span dir="ltr"><<a href="mailto:scohen@javactivity.org">scohen@javactivity.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="HOEnZb"><div class="h5">On 11/16/2011 10:27 AM, Steve Cohen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 11/16/2011 12:53 AM, Ceki Gulcu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Steve,<br>
<br>
Logback components, including appenders, should use the status<br>
manager. If you look at logback code you should see invocations of<br>
addInfo, addWarn or addError methods strewn throughout the code.<br>
<br>
--<br>
Ceki<br>
<br>
On 12.11.2011 23:14, Steve Cohen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We have a custom appender that may itself need to issue logging<br>
statements. But placing a logger in such a class causes various<br>
exceptions on initialization and loading. So we are resorting to<br>
System.out.println for lack of a better solution.<br>
<br>
I suppose there must be a better way.<br>
What would that be?<br>
</blockquote>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/<u></u>listinfo/logback-user</a><br>
<br>
<br>
</blockquote>
<br>
Thanks, Ceki. I am looking into this. I have a question, though. If you,<br>
for example, call addInfo() from an appender, which Logger decides<br>
whether or not to log it? The root logger?<br>
______________________________<u></u>_________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/<u></u>listinfo/logback-user</a><br>
<br>
<br>
</blockquote>
<br></div></div>
Looking at this a little more deeply, I see that this works, in the case of the OnConsoleStatusListener, via simply writing on the console.  But it seems that the level you choose to add (addInfo() vs addWarn() for example) affects only the status reported on the output device and there is no filtering available based on these "levels".  Is this correct?<div class="HOEnZb">
<div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/<u></u>listinfo/logback-user</a><br>
</div></div></blockquote></div><br></div>