Version 1 (modified by chase, 9 years ago)

--

log4j ConversionPattern

Example:

<11:28am>pod2/chase:/>cd $ORCA_HOME/config
<11:28am>pod2/chase:config>pwd
/opt/orca/config
<11:28am>pod2/chase:config>file container.properties
container.properties: ASCII English text
<11:28am>pod2/chase:config>grep log4j container.properties
# log4j configuration 
log4j.rootCategory = FATAL, file
log4j.appender.file = org.apache.log4j.RollingFileAppender
log4j.appender.file.File = logs/orca.log
log4j.appender.file.layout = org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern = %d [%t] %C %M %L %-5p %c - %m%n
log4j.appender.file.MaxFileSize = 1024KB
log4j.appender.file.MaxBackupIndex = 10
...

In this example, I added "%C %M %L" to the file.layout.ConversionPattern. That slows down logging, but it causes log4j to output the class (%C), method (%M), and line (%L) that generated each log message.