FAQ
I am trying to debug my map/reduce (Hadoop) app with help of the logging.
When I do grep -r in $HADOOP_HOME/logs/*

There is no line with debug info found.
I need your help. What am I doing wrong?
Thanks in advance,
Tali

In my class I put :
________________________________________________________________________________
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


LOG.warn("======");
System.out.println("====");
_________________________________________________________________________________


Here is my Log4j.properties:

log4j.rootLogger=WARN, stdout, logfile

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=app-debug.log


#log4j.appender.logfile.MaxFileSize=512KB
# Keep three backup files.
log4j.appender.logfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=MYLINE %d %p [%c] - %m%n
log4j.logger.org.apache.hadoop.mapred.TaskTracker=DEBUG

Search Discussions

  • Konstantin Boudnik at Nov 24, 2010 at 2:26 am
    Line like this
    log4j.logger.org.apache.hadoop=DEBUG

    works for 0.20.* and for 0.21+. Therefore it should work for all others :)

    So, are you trying to see your program's debug or from Hadoop ?

    --
    Cos
    On Tue, Nov 23, 2010 at 05:59PM, Tali K wrote:




    I am trying to debug my map/reduce (Hadoop) app with help of the logging.
    When I do grep -r in $HADOOP_HOME/logs/*

    There is no line with debug info found.
    I need your help. What am I doing wrong?
    Thanks in advance,
    Tali

    In my class I put :
    ________________________________________________________________________________
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;


    LOG.warn("======");
    System.out.println("====");
    _________________________________________________________________________________


    Here is my Log4j.properties:

    log4j.rootLogger=WARN, stdout, logfile

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n

    log4j.appender.logfile=org.apache.log4j.RollingFileAppender
    log4j.appender.logfile.File=app-debug.log


    #log4j.appender.logfile.MaxFileSize=512KB
    # Keep three backup files.
    log4j.appender.logfile.MaxBackupIndex=3
    # Pattern to output: date priority [category] - message
    log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
    log4j.appender.logfile.layout.ConversionPattern=MYLINE %d %p [%c] - %m%n
    log4j.logger.org.apache.hadoop.mapred.TaskTracker=DEBUG
  • Tali K at Nov 24, 2010 at 2:43 am
    Thanks,

    It worked!
    So, are you trying to see your program's debug or from Hadoop ?
    I am printing some values from my Mapper.
    Date: Tue, 23 Nov 2010 18:26:28 -0800
    From: cos@apache.org
    To: common-user@hadoop.apache.org
    Subject: Re: How to debug (log4j.properties),

    Line like this
    log4j.logger.org.apache.hadoop=DEBUG

    works for 0.20.* and for 0.21+. Therefore it should work for all others :)

    So, are you trying to see your program's debug or from Hadoop ?

    --
    Cos
    On Tue, Nov 23, 2010 at 05:59PM, Tali K wrote:




    I am trying to debug my map/reduce (Hadoop) app with help of the logging.
    When I do grep -r in $HADOOP_HOME/logs/*

    There is no line with debug info found.
    I need your help. What am I doing wrong?
    Thanks in advance,
    Tali

    In my class I put :
    ________________________________________________________________________________
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;


    LOG.warn("======");
    System.out.println("====");
    _________________________________________________________________________________


    Here is my Log4j.properties:

    log4j.rootLogger=WARN, stdout, logfile

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n

    log4j.appender.logfile=org.apache.log4j.RollingFileAppender
    log4j.appender.logfile.File=app-debug.log


    #log4j.appender.logfile.MaxFileSize=512KB
    # Keep three backup files.
    log4j.appender.logfile.MaxBackupIndex=3
    # Pattern to output: date priority [category] - message
    log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
    log4j.appender.logfile.layout.ConversionPattern=MYLINE %d %p [%c] - %m%n
    log4j.logger.org.apache.hadoop.mapred.TaskTracker=DEBUG

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedNov 24, '10 at 1:59a
activeNov 24, '10 at 2:43a
posts3
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Tali K: 2 posts Konstantin Boudnik: 1 post

People

Translate

site design / logo © 2022 Grokbase