Home > logging > Log4j multiple appender

Log4j multiple appender

March 13Hits:1
Advertisement

I am trying to add logger in project. I want to log all debug level messages to a log file. I want to add the all info level message to console.

I am using log4j properties. can you please help me?

log4j.rootLogger=INFO, STDOUT,file log4j.logger.STDOUT = INFO, STDOUT log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n  log4j.logger.file = DEBUG, file  log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=game.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1}:%L - %m%n 
Tags:logging

Related Articles

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.466 s.