Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to change the log level of a MR job

avatar
New Contributor

Hi,

I am trying to change the log level of a MR job, I used the following command : 

hadoop jar appMR.jar MainMR -Dmapreduce.map.log.level=DEBUG <args...>

but the -Dmapreduce.map.log.level=DEBUG goes as the first argument to the job.  

 Is there any way to do this only for specific MR jobs without changes the level in the log4j properties file ? 
1 ACCEPTED SOLUTION

avatar
Mentor
You may only use the -Dname=value form if your main class implements the
Tool interface and gets invoked via the ToolRunner utility. Check the Tool
javadoc example and model your implementation around it:
http://archive.cloudera.com/cdh5/cdh/5/hadoop/api/org/apache/hadoop/util/Tool.html

View solution in original post

2 REPLIES 2

avatar
Master Collaborator

To turn on debug mode on the job level, issue the following command before executing the job:
export HADOOP_ROOT_LOGGER=hadoop.root.logger=Debug,console
or add -Dhadoop.root.logger=DEBUG,console"

 

avatar
Mentor
You may only use the -Dname=value form if your main class implements the
Tool interface and gets invoked via the ToolRunner utility. Check the Tool
javadoc example and model your implementation around it:
http://archive.cloudera.com/cdh5/cdh/5/hadoop/api/org/apache/hadoop/util/Tool.html