hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "W.P. McNeill" <bill...@gmail.com>
Subject How do I log from my map/reduce application?
Date Mon, 13 Dec 2010 18:05:53 GMT
I would like to use Hadoop's Log4j infrastructure to do logging from my
map/reduce application.  I think I've got everything set up correctly, but I
am still unable to specify the logging level I want.

By default Hadoop is set up to log at level INFO.  The first line of its
log4j.properties file looks like this:


I have an application whose reducer looks like this:

package com.me;

public class MyReducer<...> extends Reducer<...> {
   private static Logger logger =

   protected void reduce(...) {
       logger.debug("My message");

I've added the following line to the Hadoop log4j.properties file:


I expect the Hadoop system to log at level INFO, but my application to log
at level DEBUG, so that I see "My message" in the logs for the reducer task.
 However, my application does not produce any log4j output.  If I change the
line in my reducer to read logger.info("My message") the message does get
logged, so somehow I'm failing to specify that log level for this class.

I've also tried changing the log4j line for my app to
read log4j.logger.com.me.MyReducer=DEBUG,console and get the same result.

I've been through the Hadoop and log4j documentation and I can't figure out
what I'm doing wrong.  Any suggestions?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message