What I get is a logging to both systems without the necessary differentiation.
The log4j property file:
# Sets root logger level to INFO
# Sets its appender to CONSOLE.
log4j.rootLogger=INFO, CONSOLE
# Sets my own logger
log4j.logger.STOCK=DEBUG, STOCK
# Sets the appender to CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
# Sets the appender for STOCK to FileAppender
log4j.appender.STOCK=org.apache.log4j.FileAppender
log4j.appender.STOCK.File=/usr/home/props/logs/StockLogger.log
# CONSOLE uses PatternLayout.
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%m%n
# STOCK uses PatterLayout
log4j.appender.STOCK.layout=org.apache.log4j.PatternLayout
log4j.appender.STOCK.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Print only message for the following packages
log4j.logger.StockCurrentPrice=INFO,CONSOLE,STOCK
log4j.additivity.StockCurrentPrice=false
Any ideas?
No comments:
Post a Comment