[logback-user] How to log FROM an appender?

TJ Rothwell tj.rothwell at gmail.com
Tue Nov 15 04:37:00 CET 2011


I'm curious: what use-case is fulfilled by the additional messages
generated by the appender?

-- TJ

On Mon, Nov 14, 2011 at 4:00 PM, Steve Cohen <scohen at javactivity.org> wrote:

> On 11/12/2011 04:14 PM, Steve Cohen wrote:
>
>> We have a custom appender that may itself need to issue logging
>> statements. But placing a logger in such a class causes various
>> exceptions on initialization and loading. So we are resorting to
>> System.out.println for lack of a better solution.
>>
>> I suppose there must be a better way.
>> What would that be?
>>
>>
>> ______________________________**_________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>>
>>
>>  A technique that seems to work is to NOT declare a logger in the
> Appender class that you want to use one from, but instead create a static
> logger instance somewhere that is accessible through static methods.  That
> way the logger does not need to be created at the time of appender
> instantiation.
>
> ______________________________**_________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111114/80173c94/attachment.html>


More information about the Logback-user mailing list