There appears a getLogger() that will take you to the native java.util.logging instance:
http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/Jdk14Logger.html


From there, you should be able to call the native setLevel() of the 1.4 logger:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Logger.html#setLevel(java.util.logging.Level)


Glen


Peter B. West wrote:


Glen,

As I read the docs, I can have a Log4J, a JDK1.4, or a SimpleLog, depending on 1) my property file or service discovery setup, if any, or the default factory discovery method. The default method (LogFactoryImpl) will
1) give me a Log4J logger, if available
2) give me a 1.4 Logger, if available
3) give me a SimpleLog.


If I get the default SimpleLog, which implements Log, I can have SetLevel, but if I use the 1.4 logger, I do not have access to the corresponding 1.4 facility. This looks like an oversight in the definition of the 1.4 logger. I'll subscribe to the Commons lists and check this.

Peter

Glen Mazza wrote:

I think it's just setLevel() that you're looking for:
http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/SimpleLog.html


Peter B. West wrote:


I see that you have the move to commons-logging. I was encouraged by
this because of the support for 1.4 logging, which I have started to use
in alt-design. When I looked at modifying the existing alt-design code
to use common-logging, however, I could find no way to set the logging
level on an existing logger, as there is, e.g., in SimpleLog. I can
specify a default level in commons-logging.properties (I assume - I
haven't tried it), but if I want to dynamically change the level in
response to the options with the existing implementation, I'm stumped.



Reply via email to