Ceki Gülcü wrote:
> 
> Claus,
> 
> They are there. Please see under 
>$LOG4J_HOME/src/java/org/apache/log4j/xml/test/test11.xml
> 
> Regards, Ceki
> 

Ceki:

Ooh, I should have found them before sending the mail....

Anyway, I assembled a config file like this, which is not working:

-------------------------------------------
#
# set root category priority to DEBUG,
# it supports only the console per default
log4j.rootCategory=DEBUG, consoleApp

#
# we will use two appenders (destinations): the console (default)
# and 2 log files
# consoleApp is set to be a ConsoleAppender, fileApps go to a file
log4j.appender.consoleApp=org.apache.log4j.ConsoleAppender

log4j.appender.debugfileApp=org.apache.log4j.RollingFileAppender
# name of the logfile
log4j.appender.debugfileApp.File=debug.log
# each log file will have a maximum size of 100 kB
log4j.appender.debugfileApp.MaxFileSize=100KB
# keep 5 backup files
log4j.appender.debugfileApp.MaxBackupIndex=5

log4j.appender.warnfileApp=org.apache.log4j.RollingFileAppender
# name of the logfile
log4j.appender.warnfileApp.File=warn.log
# each log file will have a maximum size of 100 kB
log4j.appender.warnfileApp.MaxFileSize=100KB
# keep 5 backup files
log4j.appender.warnfileApp.MaxBackupIndex=5

#
# consoleApp uses PatternLayout, fileApps too.
# consoleApp uses the short timestamp: milliseconds since startup
log4j.appender.consoleApp.layout=org.apache.log4j.PatternLayout
log4j.appender.consoleApp.layout.ConversionPattern=%-4r [%t] %-5p %c %x
- %m%n

# print the date in ISO 8601 format for the debug file
log4j.appender.debugfileApp.layout=org.apache.log4j.PatternLayout
log4j.appender.debugfileApp.layout.ConversionPattern=%d [%t] %-5p %c -
%m%n

# print the date in ISO 8601 format for the warn file
log4j.appender.warnfileApp.layout=org.apache.log4j.PatternLayout
log4j.appender.warnfileApp.layout.ConversionPattern=%d [%t] %-5p %c -
%m%n

# print only messages of priority DEBUG only in the package com.foo
log4j.appender.debugfileApp.filter=org.apache.log4j.varia.PriorityMatchFilter
log4j.appender.debugfileApp.filter.PriorityToMatch=DEBUG
log4j.appender.debugFileApp.filter.AcceptOnMatch=true
log4j.category.com.foo=DEBUG, debugfileApp

# let log4j log itself
log4j.debug=true

---------------------------------------------------

The log4j output on parsing the config file is 

log4j: Parsing for [root] with value=[DEBUG, consoleApp].
log4j: Priority token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "consoleApp".
log4j: Parsing layout options for "consoleApp".
log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x -
%m%n].
log4j: End of parsing for "consoleApp".
log4j: Parsed "consoleApp" options.
log4j: Parsing for [com.foo] with value=[DEBUG, debugfileApp].
log4j: Priority token is [DEBUG].
log4j: Category com.foo set to DEBUG
log4j: Parsing appender named "debugfileApp".
log4j: Parsing layout options for "debugfileApp".
log4j: Setting property [conversionPattern] to [%d [%t] %-5p %c - %m%n].
log4j: End of parsing for "debugfileApp".
log4j: Setting property [maxFileSize] to [100KB].
log4j: Setting property [maxBackupIndex] to [5].
log4j:WARN Failed to set property filter to value
"org.apache.log4j.varia.PriorityMatchFilter". No setter for property
log4j: Setting property [file] to [debug.log].
log4j: Parsed "debugfileApp" options.
log4j: Handling log4j.additivity.com.foo=[null]
log4j: Finished
configuring.                                                

File "debug.log' has been created but log4j loggs both levels DEBUG and
WARN into it.

If I disable the package related line
#log4j.category.com.foo=DEBUG, debugfileApp

there are no warnings on startup (of course) but no logfile either (of
course), since I didn't connect a category with an appender. The syntax
of the filter settings seem to be ok.

What's wrong with the above config file?

Any help is welcome!

Regards
Claus

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

Reply via email to