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


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



Reply via email to