[logback-user] Logback always writes to the console
Rene Reuter
maybedoo at gmx.de
Wed Nov 14 15:17:18 CET 2007
Hi,
I've solved the problem now. I've forgotten to call:
loggerContext.shutdownAndReset();
Thanks for your help!
Regards,
May
-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On
Behalf Of Chad La Joie
Sent: 14 November 2007 12:34
To: logback users list
Subject: Re: [logback-user] Logback always writes to the console
What type of application is this? If having a logging configuration
file on the classpath is acceptable that's probably the easiest
mechanism. If it's not then the code you have should work to load your
file.
Again, though, if you something is attempting to log messages before
this code is called than logback will use a default configuration which
does log to the console.
Rene Reuter wrote:
> Hi,
>
> There no other logback.xml or logback-test.xml file in the classpath. In
my
> main class I've configured joran:
>
> LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
> JoranConfigurator jc = new JoranConfigurator();
> jc.setContext(lc);
> try {
> jc.doConfigure("logback.xml");
> } catch (JoranException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
>
> Normally that should work?
>
> May
>
> -----Original Message-----
> From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On
> Behalf Of Chad La Joie
> Sent: 14 November 2007 12:13
> To: logback users list
> Subject: Re: [logback-user] Logback always writes to the console
>
> Rene,
> If that is your whole file I would guess that it was one of two things:
>
> - Something is trying to using the logback before it's configured and so
> logback is using its default configuration (which logs to console)
>
> - There is another logback.xml file on your classpath that does log to
> console and that is being loaded in addition to your configuration file
>
> I'm using 0.9.8 and I don't experience this issue, so I don't think it's
> a bug.
>
> Rene Reuter wrote:
>> I'm using Logback 0.9.8. I've configured my logback.xml file only with a
>> FileAppender.
>>
>> But it always logs to the console too, why? I don't want to see the logs
>> in the console.
>>
>> Do u know why?
>
>
--
SWITCH
Serving Swiss Universities
--------------------------
Chad La Joie, Software Engineer, Security
Werdstrasse 2, P.O. Box, 8021 Zurich, Switzerland
phone +41 44 268 15 75, fax +41 44 268 15 68
chad.lajoie at switch.ch, http://www.switch.ch
_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://qos.ch/mailman/listinfo/logback-user
More information about the Logback-user
mailing list