Winston,

What you are describing is considered to be correct behavior, though I have
to agree it seems a bit unexpected.  If you look back a few days in the
archive for this list, you will find a discussion about it.  Basically, when
the hierarchy is reconfigured, any categories that have been previously
configured, but are now not referenced in the new configuration, they are
not "reset".  They continue logging at their previous priority setting and
to any appenders they may have referenced (if those appenders were not
closed as part of the reconfiguring).

For the next nect version of log4j (1.3?) I am looking to add behavior to
"reset" the hierarchy when reconfigured.  You could also call
resetConfiguration(), but there is no way for you to do that in
configureAndWatch() without modifying the log4j code.

-Mark

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 4:06 PM
To: [EMAIL PROTECTED]
Subject: configureAndWatch bug




I've discovered what I consider a bug in Log4J version 1.1.3. I use the
PropertyConfigurator.configureAndWatch(configFile) to configure log4j. I
have a
pretty minimal properties file that I use for configuration. It contains
just 1
appender (ConsoleAppender) and a few categories that exist along one branch
of
the hierarchy like so:

log4j.rootCategory=INFO, MAIN
log4j.appender.MAIN=org.apache.log4j.ConsoleAppender

log4j.category.X=DEBUG
log4j.category.X.Y=ERROR
log4j.category.X.Y.Z=INFO

There appears to be a problem if I *remove* or comment out the category
X.Y.Z
line. If X.Y.Z contains logger.info("...") statements, when I delete the
line
from the properties file, the change is not reflected in log4j after the
default
 60 second wait time. Info log messages continually are sent to the log even
though only ERROR messages should be.

It appears to me that the problem lies in the hierarchy updates. A new
Hierarchy
 object isn't getting generated when a change to the properties file is
made, it
 is merely updated. If I change X.Y.Z to ERROR in the properties file,
everything works as expected, it is only a problem when I delete or comment
out
X.Y.Z in log4j.properties.

Has anyone else experienced this behavior?
-wr



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

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

Reply via email to