我捕获了NullPointerException,但log4j没有打印堆栈跟踪信息,我希望能够输出异常发生的行数,这是怎么回事?
我的日志:
我的日志:
20110412-101042,317[ Timer-7][R] Exception while processing for value: abc. [xyz.Dummy]
java.lang.NullPointerException
log4j.property
file
log4j.rootCategory=ERROR, logfile
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p %r [%t] : %m%n
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=my_application.log
log4j.appender.logfile.Append=true
log4j.appender.logfile.MaxBackupIndex =10
log4j.appender.logFile.MaxFileSize=40000KB
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d{yyyyMMdd-HHmmss,SSS}[%8.8t][%.1p] %-70m[%c{2}]%n
我的代码片段
String value;
try {
value = "abc";
//... lots for code
}catch(Exception e) {
logger.error("Exception while processing for value: " + value + ". ", e);
}