I have noticed a problem in the microlog-20090927 snapshot that the logger has to be configured before I turn to the LoggerFactory for a logger object otherwise a change of the default log level will not have any effect.
I would like to suggest that a change in the log-level also effects already created logging objects.
Why: Its a common practice from using log4j to initialize the log object at the same time you declare the log object in its class.
class MyClass {
private static final Logger s_log = LoggerFactory.getLogger(MyClass.class);
do() { s_log.debug("message"); }
}
The logger object gets automatic created when the class is loaded by the java runtime and is ready to be used from the first line of code in the class. Very handy and convenient. Currently if the log level is changed later, all classes loaded up to the configuration point will be stick with the previous log-level.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have noticed a problem in the microlog-20090927 snapshot that the logger has to be configured before I turn to the LoggerFactory for a logger object otherwise a change of the default log level will not have any effect.
I would like to suggest that a change in the log-level also effects already created logging objects.
Why: Its a common practice from using log4j to initialize the log object at the same time you declare the log object in its class.
class MyClass {
private static final Logger s_log = LoggerFactory.getLogger(MyClass.class);
do() { s_log.debug("message"); }
}
The logger object gets automatic created when the class is loaded by the java runtime and is ready to be used from the first line of code in the class. Very handy and convenient. Currently if the log level is changed later, all classes loaded up to the configuration point will be stick with the previous log-level.
Hi,
I will take a look at this tonight. It sounds reasonable to do it the way you suggest.
Regards
Johan
I look forward to your new drop with this fix, thanks.
Hi,
I am sorry but I am a little bit delayed. Will try to fix this before the 2.0 final release.
Regards
Johan