You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Dharanendra S. Pandit" <Dh...@netscape.net> on 2002/04/01 14:28:06 UTC
Bug??
Hi *.*,
I'm facing a strange problem. I have specified the following properties
in configuration file.
log4j.rootCategory=stdout, file
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p %c - %m%n
log4j.priority.stdout=ERROR
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.layout=org.apache.log4j.HTMLLayout
log4j.appender.file.File=log4j.html
log4j.priority.file=WARN
In summary,
stdout uses a "ConsoleAppender", a "PatternLayout" and its priority is
set to "ERROR".
file uses a "FileAppender", a "HTMLLayout" and its priority is set to
"WARN".
Only messages having priority of "ERROR" and "FATAL" are logged to
Console. This is absolutely fine.
But, the problem is in FileAppender. Even after specifying the priority
as "WARN", all messages having priority "DEBUG" and "INFO" are getting
logged into the log4j.html file. Looks like its ignoring my prority and
taking the rootCategory priority which by default is "DEBUG". How to
solve this problem? I have no idea whether this is a bug or my
configuration file is set wrongly. I request some one to provide me a
solution if my configuration is set wrongly.
I had another problem, which I have already put forth before the forum,
but have not yet got any solution.
If I specify my ConversionPattern for the FileAppender, it is ignoring
and taking the default one.
I need a pattern of,
log4j.appender.file.layout.ConversionPattern=%-5p %c - %m%n. How to
specify this?
Expecting an early response.
Pandit
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>