[logback-dev] Official "Holler!" concerning my topic on stackoverflow.com
jhuxhorn at googlemail.com
Tue Jun 9 15:20:01 CEST 2009
I've set the context, now.
15:17:48,284 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File
property is set to [/tmp/logging17790log]
Nothing about attaching this to that or "root level set to ALL".
On 09.06.2009, at 14:59, Ceki Gulcu wrote:
> Hello Joern,
> It looks like you are not setting the context for the PatternLayout.
> To see what is going on, you should invoke StatusPrinter. It will
> tell you what you are missing.
> Joern Huxhorn wrote:
>> On 08.06.2009, at 20:47, Ceki Gulcu wrote:
>>> Hi Joern,
>>> To set the level of a logger:
>>> import ch.qos.logback.classic.Logger;
>>> LoggerContext loggerContext = (LoggerContext) loggerFactory;
>>> Logger logger = (Logger) loggerContext.getLogger("a.name");
>>> Level oldLevel = logger.getLevel();
>>> logger.setLevel(Level.a_level_of_your choice);
>>> To create an appender, there are a bunch of examples under
>>> see for example
>>> Once you create an appender, you can easily associate it with a
>>> You can later remove it by invoking
>>> logger.detachAppender(appender) // detach by appender reference
>>> logger.detachAppender("appender name"); // detach by name
>>> Let me know if you have further questions. HTH,
>> Hi Ceki,
>> I tried to implement the test-base like this but nothing was
>> written to the logfile. The files are created but they have a size
>> of 0 bytes.
>> Please have a look at http://apps.sourceforge.net/trac/sulky/browser/trunk/sulky-junit/src/main/java/de/huxhorn/sulky/junit/LoggingTestBase.java
>> My futile attempt is commented out.
>> I'm sure I miss something really stupid :p
>> Beside that, is there some easier way to just restart the usual
>> logging configuration process instead of manually doing it like I
>> do in resetLogging?
>> logback-dev mailing list
>> logback-dev at qos.ch
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework
> for Java.
> logback-dev mailing list
> logback-dev at qos.ch
More information about the logback-dev