[logback-user] How to log FROM an appender?
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?
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
>> 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
> Logback-user mailing list
> Logback-user at qos.ch
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Logback-user