flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahendran m <mahendra...@hotmail.com>
Subject logging both to console and log file
Date Sat, 10 Jan 2015 05:39:08 GMT
Hi ,
Is it possible to use both logging to console with only message as ERROR and logging full
information to log file . i have set threshold level to error
sample log4j.properties file like below  

flume.root.logger=INFO,DEBUG,LOGFILEflume.log.dir=/logsflume.log.file=flume.log
log4j.logger.org.apache.flume.lifecycle = INFOlog4j.logger.org.jboss = WARNlog4j.logger.org.mortbay
= INFOlog4j.logger.org.apache.avro.ipc.NettyTransceiver = WARNlog4j.logger.org.apache.hadoop
= INFO
# Define the root logger to the system property "flume.root.logger".log4j.rootLogger=${flume.root.logger}
# Default log rotation configurationlog4j.appender.LOGFILE=org.apache.log4j.RollingFileAppenderlog4j.appender.LOGFILE.Threshold
= ERRORlog4j.appender.LOGFILE.MaxFileSize=1MBlog4j.appender.LOGFILE.MaxBackupIndex=10log4j.appender.LOGFILE.File=${flume.log.dir}/${flume.log.file}log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayoutlog4j.appender.LOGFILE.layout.ConversionPattern=%d{dd
MMM yyyy HH:mm:ss,SSS} %-5p [%t] (%C.%M:%L) %x - %m%n
# Add "console" to flume.root.logger above if you want to use thislog4j.appender.console=org.apache.log4j.ConsoleAppenderlog4j.appender.console.Threshold
= ERRORlog4j.appender.console.target=System.errlog4j.appender.console.layout=org.apache.log4j.PatternLayoutlog4j.appender.console.layout.ConversionPattern=[%p]

for logging to console need only value ERROR no more information so configured as like this
log4j.appender.console.layout.ConversionPattern=[%p]

but above configuration not working as i wished. please help.thanks, 		 	   		  
Mime
View raw message