----- Original Message ----- 
From: "robert burrell donkin" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
Cc: "Robert Oxspring" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 8:26 PM
Subject: Re: [Logging] Where is my configuration coming from?


> 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.

It certainly does!  I hadn't noticed the setLevel() method before.

Thanks,

Rob

> 
> - robert
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to