commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [Logging] Where is my configuration coming from?
Date Tue, 25 Feb 2003 20:26:01 GMT
On Saturday, February 22, 2003, at 04:16 PM, Robert Oxspring wrote:

> I'm trying to use Commons-Logging within an app and figured that it would 
> be useful to turn on trace logging in a test case while doing some 
> debugging.  To do this I put code along the lines of the following in the 
> setUp() method of the testcase:
>          
> System.setProperty("org.apache.commons.logging.simplelog.log."+getName(),"trace"
> );
>        Log log =  new SimpleLog(getName());
>        target.setLog(log);
>
> But the logging output refuses to show anything below the default "info" 
> level.

the following has worked for me in similar situations:

     SimpleLog log =  new SimpleLog(getName());
     log.setLevel(SimpleLog.LOG_LEVEL_TRACE);
     target.setLog(log);

(i have a feeling that the default log level is set the first time that 
any log is obtained and remains fixed.)

hope that this solves your problem.

- robert


Mime
View raw message