Hadoop enable logging

2019-02-19 14:18发布

问题:

I am trying to work with hadoop built from source in a single cluster mode.I checked out 0.22.0-alpha-1.I am facing few problems with logging. How do i enable debug logs.

I tried adding

log4j.logger.org.apache.hadoop.mapred.JobTracker=DEBUG
log4j.logger.org.apache.hadoop.mapred.TaskTracker=DEBUG 

in log4j.properties.

But it doesn't seem to work.Can some one help me with enabling debug logs.Also i would like to know if there are any other logs i can enable apart from Jobtracker and tasktracker and the corresponding lines to add in log4j.properties file.

Also i tried adding few LOG.info() statements in the code and compiled them and ran hadoop jobs over them. But i am not able to get these log statements printed out at the console like some other logs that appear on the console. Please let me know if i am missing something.

Thanks

回答1:

I'd suggest trying

log4j.logger.org.apache.hadoop = DEBUG

for debug logging inside of every Hadoop class.

If this doesn't work, then you haven't configured log4j properly.



标签: log4j hadoop