FAQ
Hi all,

In the hadoop-0.11.1-core.jar, there is already a log4j.properties file. I
am using commons-logging and log4j now, so I tried to remove the
commons-logging.properties and log4j.properties files out of the jar, and
put them into the classpath. But if I did that, the application always gives
me a warning:

log4j:WARN No appenders could be found for logger (
org.apache.commons.configuration.ConfigurationUtils).
log4j:WARN Please initialize the log4j system properly.

It seems that I have to keep these two properties files in the jar, and I
really need to override the log level to make my own program printing more
info, but meanwhile I also want to keep the hadoop's log level as INFO. In
the other words, I have only interest on my own program.

So what should I do?

Andrew

Search Discussions

  • Dennis Kubes at Feb 17, 2007 at 5:46 pm
    There is a log4j.properties file in the conf directory as well. This
    directory is conf by default but can be changed via the HADOOP_CONF_DIR
    variable. Although I haven't tested it I believe it can also be set
    through the classpath.

    Dennis Kubes

    Andrew Jsyqf wrote:
    Hi all,

    In the hadoop-0.11.1-core.jar, there is already a log4j.properties file. I
    am using commons-logging and log4j now, so I tried to remove the
    commons-logging.properties and log4j.properties files out of the jar, and
    put them into the classpath. But if I did that, the application always
    gives
    me a warning:

    log4j:WARN No appenders could be found for logger (
    org.apache.commons.configuration.ConfigurationUtils).
    log4j:WARN Please initialize the log4j system properly.

    It seems that I have to keep these two properties files in the jar, and I
    really need to override the log level to make my own program printing more
    info, but meanwhile I also want to keep the hadoop's log level as INFO. In
    the other words, I have only interest on my own program.

    So what should I do?

    Andrew
  • Feng Jiang at Feb 17, 2007 at 5:51 pm
    I did find the conf directory in the jar file.

    How can I set the HADOOP_CONF_DIR?

    Andrew
    On 2/18/07, Dennis Kubes wrote:

    There is a log4j.properties file in the conf directory as well. This
    directory is conf by default but can be changed via the HADOOP_CONF_DIR
    variable. Although I haven't tested it I believe it can also be set
    through the classpath.

    Dennis Kubes

    Andrew Jsyqf wrote:
    Hi all,

    In the hadoop-0.11.1-core.jar, there is already a log4j.properties file. I
    am using commons-logging and log4j now, so I tried to remove the
    commons-logging.properties and log4j.properties files out of the jar, and
    put them into the classpath. But if I did that, the application always
    gives
    me a warning:

    log4j:WARN No appenders could be found for logger (
    org.apache.commons.configuration.ConfigurationUtils).
    log4j:WARN Please initialize the log4j system properly.

    It seems that I have to keep these two properties files in the jar, and I
    really need to override the log level to make my own program printing more
    info, but meanwhile I also want to keep the hadoop's log level as INFO. In
    the other words, I have only interest on my own program.

    So what should I do?

    Andrew
  • Dennis Kubes at Feb 17, 2007 at 6:08 pm
    You can export it in the shell or set it in conf/hadoop-env.sh script.

    export HADOOP_CONF_DIR=....
    ./runscripthere

    If you want to use the conf/log4j.properties file then you shouldn't
    have to do anything as it is set by default.

    Dennis Kubes




    Feng Jiang wrote:
    I did find the conf directory in the jar file.

    How can I set the HADOOP_CONF_DIR?

    Andrew
    On 2/18/07, Dennis Kubes wrote:

    There is a log4j.properties file in the conf directory as well. This
    directory is conf by default but can be changed via the HADOOP_CONF_DIR
    variable. Although I haven't tested it I believe it can also be set
    through the classpath.

    Dennis Kubes

    Andrew Jsyqf wrote:
    Hi all,

    In the hadoop-0.11.1-core.jar, there is already a log4j.properties
    file.
    I
    am using commons-logging and log4j now, so I tried to remove the
    commons-logging.properties and log4j.properties files out of the jar, and
    put them into the classpath. But if I did that, the application always
    gives
    me a warning:

    log4j:WARN No appenders could be found for logger (
    org.apache.commons.configuration.ConfigurationUtils).
    log4j:WARN Please initialize the log4j system properly.

    It seems that I have to keep these two properties files in the jar, and I
    really need to override the log level to make my own program printing more
    info, but meanwhile I also want to keep the hadoop's log level as INFO. In
    the other words, I have only interest on my own program.

    So what should I do?

    Andrew
  • Feng Jiang at Feb 17, 2007 at 6:06 pm
    sorry, I mis-sent the last unfinished email. and I sent it again here:

    I did find the conf directory in the jar file, and how can I set the
    HADOOP_CONF_DIR?

    Andrew, I think you want to override the attributes which are already
    defined in log4j.properties of jar, is that right? I have not tested it
    before, but I think you can just search "log4j override" in google.
    On 2/18/07, Dennis Kubes wrote:

    There is a log4j.properties file in the conf directory as well. This
    directory is conf by default but can be changed via the HADOOP_CONF_DIR
    variable. Although I haven't tested it I believe it can also be set
    through the classpath.

    Dennis Kubes

    Andrew Jsyqf wrote:
    Hi all,

    In the hadoop-0.11.1-core.jar, there is already a log4j.properties file. I
    am using commons-logging and log4j now, so I tried to remove the
    commons-logging.properties and log4j.properties files out of the jar, and
    put them into the classpath. But if I did that, the application always
    gives
    me a warning:

    log4j:WARN No appenders could be found for logger (
    org.apache.commons.configuration.ConfigurationUtils).
    log4j:WARN Please initialize the log4j system properly.

    It seems that I have to keep these two properties files in the jar, and I
    really need to override the log level to make my own program printing more
    info, but meanwhile I also want to keep the hadoop's log level as INFO. In
    the other words, I have only interest on my own program.

    So what should I do?

    Andrew

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedFeb 17, '07 at 8:14a
activeFeb 17, '07 at 6:08p
posts5
users3
websitehadoop.apache.org...
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase