java.lang.IllegalArgumentException from log4j -
my client facing problem , has sent me log file.
log file contain few crashes written below.
log4j:warn failed set property [maxfilesize] value "10mb". java.lang.illegalargumentexception: object not instance of declaring class @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) ... log4j:warn failed set property [file] value "../logging/servicecontainer2100.log". java.lang.illegalargumentexception: object not instance of declaring class @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) ... log4j:warn failed set property [maxbackupindex] value "10 ". java.lang.illegalargumentexception: object not instance of declaring class @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) ...
enclosed log4j configuration file:
# set root logger level , appenders. log4j.rootlogger=info, a1, r # appender a1 log4j.appender.a1=org.apache.log4j.consoleappender # layout a1 log4j.appender.a1.layout=org.apache.log4j.patternlayout log4j.appender.a1.layout.conversionpattern=%d [%t] %-5p %c %x - %m%n # appender r log4j.appender.r=org.apache.log4j.rollingfileappender log4j.appender.r.file=log/dependencyanalyzer.log log4j.appender.r.maxfilesize=1000kb log4j.appender.r.maxbackupindex=10 # layout r log4j.appender.r.layout=org.apache.log4j.patternlayout log4j.appender.r.layout.conversionpattern=%d [%t] %-5p %c %x - %m%n
i tried googling couldn't satisfactory response.
can suggest dig more in problem or possible reason?
seems there wrong value of file attribute ../logging/servicecontainer2100.log
comparing value in configuration file, please try log4j.properties
configuration file , thant may give , made changes on path of file , appenders test worked me , waiting feedback
# root logger option log4j.rootlogger=debug,a1 , a, r # appender a1 log4j.appender.a1=org.apache.log4j.consoleappender # layout a1 log4j.appender.a1.layout=org.apache.log4j.patternlayout log4j.appender.a1.layout.conversionpattern=%d [%t] %-5p %c %x - %m%n # redirect log messages console log4j.appender.a=org.apache.log4j.consoleappender log4j.appender.a.target=system.out log4j.appender.a.layout=org.apache.log4j.enhancedpatternlayout log4j.appender.a.layout.conversionpattern=%d{yyyy-mm-dd hh:mm:ss} %-5p %c{1}:%l - %m%n # redirect log messages log file, support file rolling. #log4j.appender.file=org.apache.log4j.rollingfileappender #log4j.appender.file.file=file.log #log4j.appender.file.maxfilesize=5mb #log4j.appender.file.maxbackupindex=10 #log4j.appender.file.layout=org.apache.log4j.patternlayout #log4j.appender.file.layout.conversionpattern=%d{yyyy-mm-dd hh:mm:ss} %-5p %c{1}:%l - %m%n # appender r log4j.appender.r=org.apache.log4j.rollingfileappender log4j.appender.r.file=trace.log log4j.appender.r.maxfilesize=1000kb log4j.appender.r.maxbackupindex=10 # layout r log4j.appender.r.layout=org.apache.log4j.patternlayout log4j.appender.r.layout.conversionpattern=%d [%t] %-5p %c %x - %m%n
Comments
Post a Comment