Tag: Java

Customize log4j logging level

Set log level for package:

log4j.logger.MYPACKAGE=DEBUG

Set log level and custom appender:

log4j.logger.MYPACKAGE=DEBUG, MYAPPENDER
log4j.appender.MYAPPENDER=org.apache.log4j.RollingFileAppender
log4j.appender.MYAPPENDER.File=MYFILE.log
log4j.appender.MYAPPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.MYAPPENDER.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n