Posted By:
Mahesh_Ramamurthy
Posted On:
Monday, June 4, 2007 10:21 AM
Hi All, I'm using log4j for logging and Ant for building my project. The logs are generated successfully, but no line numbers appear in the log file. Following is the piece of my log4j.properties. #### Use two appenders, one to log to console, another to log to a file log4j.rootCategory= DEBUG,R #### First appender writes to console #log4j.appender.stdout=org.apache.log4j.ConsoleAppender #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. #log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F%L)
More>>
Hi All,
I'm using log4j for logging and Ant for building my project. The logs are generated successfully, but no line numbers appear in the log file. Following is the piece of my log4j.properties.
#### Use two appenders, one to log to console, another to log to a file
log4j.rootCategory= DEBUG,R
#### First appender writes to console
#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
#log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F%L) - %m%n
#### Second appender writes to a file
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:/workspace/datastore/logs/datastore.log
# Control the maximum log file size
log4j.appender.R.MaxFileSize=10000KB
# Archive log files (one backup file here)
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %d %t %c: (%F%L) - %m%n
Sample log output file - ?? in place of the line numbers
DEBUG 2007-06-04 09:44:50,597 main com.siemens.ssl.datastore.dao.InvoiceDao: (??) - New Invoice insert to ezEis....
DEBUG 2007-06-04 09:44:50,597 main com.siemens.ssl.datastore.dao.InvoiceDao: (??) - Creating object for insert into EZSUITE_EIS_MAPPING for guid EI-04032007071505-95
Any help is appreciated.
Thanks
Mahesh
<<Less