log4j.properties

log4j配置范例:

# log4j.rootLogger=[level], [appenderName1], [appenderName2], ...
log4j.rootLogger=DEBUG, A1

# log4j.appender.[appenderName]=[fully.qualified.name.of.appender.class]
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=log.txt

# log4j.appender.[appenderName].layout=[fully.qualified.name.of.layout.class]
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n

你可能感兴趣的:(log4j)