Martin Poruban created LOG4NET-364: -------------------------------------- Summary: Can't assign custom level to threshold Key: LOG4NET-364 URL: https://issues.apache.org/jira/browse/LOG4NET-364 Project: Log4net Issue Type: Bug Components: Appenders Affects Versions: 1.2.12 Environment: Java 1.6.31 x86 Reporter: Martin Poruban
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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira