You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by Hanish Bansal <ha...@gmail.com> on 2014/09/29 14:00:40 UTC

How to overwrite container-log4j.properties file

Hi All,

I want to use custom logging for map-reduce application so i want to
configure my log4j.properties file in hadoop.
I want that logging of all containers should be happen according to my
log4.properties file.

For this i updated different properties in mapred-site.xml configuration
file. For example:

<property>
<name>mapreduce.map.log.level</name>
<value>INFO,flume
-Dlog4j.configuration=/home/hanish/Desktop/log4j.properties</value>
</property>

<property>
<name>mapreduce.reduce.log.level</name>
<value>INFO,flume
-Dlog4j.configuration=/home/hanish/Desktop/log4j.properties
-Dhadoop.root.logger=INFO,flume</value>
</property>
<property>
<name>yarn.app.mapreduce.am.command-opts</name>
<value>-Dlog4j.configuration=/home/hanish/Desktop/log4j.properties
-Xmx1024m -Dhadoop.root.logger=INFO,flume</value>
</property>

<property>
<name>yarn.app.mapreduce.am.admin-command-opts</name>
<value>-Dlog4j.configuration=/home/hanish/Desktop/log4j.properties</value>
</property>

Using this configuration MRAppMaster is getting started with more one
log4j.configuration variables and logging is done according to
container-log4j.properties file. Please find the jps information of
Application master is:

19812 MRAppMaster -Dlog4j.configuration=container-log4j.properties
-Dyarn.app.container.log.dir=/home/hanish/opt/hadoop-2.2.0/logs/userlogs/application_1411987111980_0001/container_1411987111980_0001_01_000001
-Dyarn.app.container.log.filesize=0 -Dhadoop.root.logger=INFO,CLA
-Dlog4j.configuration=/home/hanish/Desktop/log4j.properties
-Dlog4j.configuration=/home/hanish/Desktop/log4j.properties -Xmx1024m
-Dhadoop.root.logger=INFO,flume
5959 Application -Xmx20m -Dflume.root.logger=DEBUG,console
-Djava.library.path=:/home/hanish/opt/hadoop-2.2.0/lib/native

Please let me know how to overwrite container-log4j.properties file ?


-- 
*Thanks & Regards*
*Hanish Bansal*