Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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