[logback-user] Programmmatically creating logger/appender/pattern

Ceki Gulcu ceki at qos.ch
Wed Mar 25 17:02:27 CET 2009


Hello Lance,

Look into the junit test cases which do that type of operation all the time. For 
example, see:

http://logback.qos.ch/xref-test/ch/qos/logback/classic/html/HTMLLayoutTest.html
http://logback.qos.ch/xref-test/ch/qos/logback/core/rolling/SizeBasedRollingTest.html

If that does not help, post your code here.

Lance White wrote:
> Has anyone got any examples on how to programmatically create a logger /
> appender / pattern et. al in-line in code?
> 
> I can't for the life of me get this running. Currently I've got the
> appender  (file appender in this case) creating the output files, but
> all I get in them is stuff like:
> 
>  %PARSER_ERROR_d:MODULE:%PARSER_ERROR_msg%
> 
> Which looks like the pattern stuff isn't started up properly.
> 
> Cheers
> 
> Lance

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch


More information about the Logback-user mailing list