Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
1.2.12
-
None
-
Java 1.6.31 x86
Description
When i try assign custom level to appender, this level is ignored and appender have assigned debug level.
Code from my property file.
llog4j.rootLogger=DEBUG,A3
log4j.appender.A3=org.apache.log4j.RollingFileAppender
log4j.appender.A3.File=user3.log
log4j.appender.A3.Threshold=USER3#com.test.log.CustomLevel
log4j.appender.A3.MaxFileSize=1MB
log4j.appender.A3.MaxBackupIndex=10
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n
output from debug console
log4j: Parsing for [root] with value=[DEBUG,A3].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "A3".
log4j: Parsing layout options for "A3".
log4j: Setting property [conversionPattern] to [%d %5p [%t] (%F:%L) - %m%n].
log4j: End of parsing for "A3".
log4j: Setting property [maxFileSize] to [1MB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: toLevel:class=[com.test.log.CustomLevel]:pri=[USER3]
log4j: Setting property [threshold] to [DEBUG].
log4j: Setting property [file] to [user3.log].
log4j: setFile called: user3.log, true
log4j: setFile ended
log4j: Parsed "A3" options.
But when i change threshold to default level e.g. WARN
log4j.rootLogger=DEBUG,A3
log4j.appender.A3=org.apache.log4j.RollingFileAppender
log4j.appender.A3.File=user3.log
log4j.appender.A3.Threshold=WARN
log4j.appender.A3.MaxFileSize=1MB
log4j.appender.A3.MaxBackupIndex=10
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n
then all is ok
log4j: Parsing for [root] with value=[DEBUG,A3].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "A3".
log4j: Parsing layout options for "A3".
log4j: Setting property [conversionPattern] to [%d %5p [%t] (%F:%L) - %m%n].
log4j: End of parsing for "A3".
log4j: Setting property [maxFileSize] to [1MB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [threshold] to [WARN].
log4j: Setting property [file] to [user3.log].
log4j: setFile called: user3.log, true
log4j: setFile ended
log4j: Parsed "A3" options.