How to control logging functionality in hadoop? Hadoop uses default log4j.properties file for controlling logs. My use case is to control logs generated by my classes.
Hadoop daemons like JobTracker, TaskTracker, NameNode and DataNode daemon processes use log4j.properties file from their respective host node’s hadoop-conf-directory
. The rootLogger is set to “INFO,console” which logs all message at level INFO to the console.
I trigger hadoop jobs using Oozie Workflow. I tried passing my custom log4j.properties file to the job by setting -Dlog4j.configuration=path/to/log4j.properties
system property, but it is not working. Still, it takes log4j properties from the default one.
I am not supposed to touch default log4j.properties file.
I am using Oozie-v3.1.3-incubating, hadoop-v0.20 and cloudera CDH-v4.0.1.
How can I override the default log4j.properties file ?? or How can I control logs for my classes ??