hi,

the setting of the level by using a property file doesn't work.

in the property file I've inserted the following line:

log4j.rootLogger=SQL#<classpath>.PDMSLevel, A1

the class PDMSLevel extends Level. the java code just uses the statement:

PropertyConfigurator.configure(properties);

the log output follows now:

log4j: Trying to find [log4j.properties] using context classloader
sun.misc.Launcher$AppClassLoader@71732b.
log4j: Trying to find [log4j.properties] using
sun.misc.Launcher$ExtClassLoader@7fdcde class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [log4j.properties].
log4j: Parsing for [root] with value=[SQL#<classpath>.PDMSLevel, A1].
log4j: Level token is [SQL##<classpath>.PDMSLevel].
log4j: toLevel:class=[#<classpath>]:pri=[SQL]
log4j: Category root set to DEBUG
log4j: Parsing appender named "A1".
log4j: Parsing layout options for "A1".
log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x -
%m%n].
log4j: End of parsing for "A1".
log4j: Parsed "A1" options.
log4j: Finished configuring.

it looks, as if my settings have not been used! the level of the logger
seems to remain 'DEBUG'.

Neither
        logger.log((Level) PDMSLevel.FATAL," SQL Test!!!!!!!!!");
nor
        if(logger.isEnabledFor((Level) PDMSLevel.FATAL)){
work in the way I've expected. Any time the output is written to the
console.

when using

logger.setLevel((Level) PDMSLevel.SQL);

the level of the current logger is correct.

How can I solve this problem?


-----------
"Maenner brauchen Musik", Sonnenallee, Leander Haussmann (1999)

Juergen Bluemer
empolis GmbH
An der Autobahn 2
33311 Guetersloh
Germany

Phone +49 (0) 5241 80 88739

[EMAIL PROTECTED]


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

Reply via email to