apache flume log directory -
just begin learn apache flume. follow instructions on flume official getting started website:
https://cwiki.apache.org/confluence/display/flume/getting+started
almost fine after follow instructions on above link. not find log file afterwards. suppose log file under {flume.directory}/logs. idea find flume log files?
here comes log4j.properties:
flume.root.logger=info,logfile flume.log.dir=./logs flume.log.file=flume.log log4j.logger.org.apache.flume.lifecycle = info log4j.logger.org.jboss = warn log4j.logger.org.mortbay = info log4j.logger.org.apache.avro.ipc.nettytransceiver = warn log4j.logger.org.apache.hadoop = info log4j.logger.org.apache.hadoop.hive = error # define root logger system property "flume.root.logger". log4j.rootlogger=${flume.root.logger} # stock log4j rolling file appender # default log rotation configuration log4j.appender.logfile=org.apache.log4j.rollingfileappender log4j.appender.logfile.maxfilesize=100mb log4j.appender.logfile.maxbackupindex=10 log4j.appender.logfile.file=${flume.log.dir}/${flume.log.file} log4j.appender.logfile.layout=org.apache.log4j.patternlayout log4j.appender.logfile.layout.conversionpattern=%d{dd mmm yyyy hh:mm:ss,sss} %-5p [%t] (%c.%m:%l) %x - %m%n # warning: if enable following appender fill disk if don't have cleanup job! # uses updated rolling file appender log4j-extras supports reliable time-based rolling policy. # see http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/timebasedrollingpolicy.html # add "daily" flume.root.logger above if want use log4j.appender.daily=org.apache.log4j.rolling.rollingfileappender log4j.appender.daily.rollingpolicy=org.apache.log4j.rolling.timebasedrollingpolicy log4j.appender.daily.rollingpolicy.activefilename=${flume.log.dir}/${flume.log.file} log4j.appender.daily.rollingpolicy.filenamepattern=${flume.log.dir}/${flume.log.file}.%d{yyyy-mm-dd} log4j.appender.daily.layout=org.apache.log4j.patternlayout log4j.appender.daily.layout.conversionpattern=%d{dd mmm yyyy hh:mm:ss,sss} %-5p [%t] (%c.%m:%l) %x - %m%n # console # add "console" flume.root.logger above if want use log4j.appender.console=org.apache.log4j.consoleappender log4j.appender.console.target=system.err log4j.appender.console.layout=org.apache.log4j.patternlayout log4j.appender.console.layout.conversionpattern=%d (%t) [%p - %l] %m%n
cause configuration use relative path :
flume.log.dir=./logs log4j.appender.logfile.file=${flume.log.dir}/${flume.log.file}
flume use current directory log.
(the directory when launch flume)
you can use absolute path flume.log.dir
if want force flume log in path, no matter launch it.
Comments
Post a Comment