hadoop daemonlog
The hadoop daemonlog
command gets and sets the log
level for each daemon.
Hadoop daemons all produce logfiles that you can use to learn
about what is happening on the system. You can use the hadoop
daemonlog
command to temporarily change the log level of a
component when debugging the system.
Syntax
hadoop daemonlog
-getlevel | -setlevel
<host>:<port>
<name>
[ <level> ]
Parameters
The following command options are supported for hadoop
daemonlog
command:
Parameter |
Description |
---|---|
|
Prints the log level of the daemon running at the specified host and port, by querying
|
|
Sets the log level of the daemon running at the specified host and port, by querying
* <host> : The host on which to set the log
level.
|
Examples
Getting the log levels of a daemon
To get the log level for each daemon enter a command such as the following:
hadoop daemonlog -getlevel 10.250.1.15:50030 org.apache.hadoop.yarn.server.resourcemanager.resourcemanager
Connecting to http://10.250.1.15:50030/logLevel?log=org.apache.hadoop.yarn.server.resourcemanager.resourcemanager
Submitted Log Name: org.apache.hadoop.yarn.server.resourcemanager.resourcemanager
Log Class: org.apache.commons.logging.impl.Log4JLogger
Effective level: ALL
Setting the log level of a daemon
To temporarily set the log level for a daemon enter a command such as the following:
hadoop daemonlog -setlevel 10.250.1.15:50030 org.apache.hadoop.yarn.server.resourcemanager.resourcemanager DEBUG
Connecting to http://10.250.1.15:50030/logLevel?log=org.apache.hadoop.yarn.server.resourcemanager.resourcemanager&level=DEBUG
Submitted Log Name: org.apache.hadoop.yarn.server.resourcemanager.resourcemanager
Log Class: org.apache.commons.logging.impl.Log4JLogger
Submitted Level: DEBUG
Setting Level to DEBUG ...
Effective level: DEBUG
Using this method, the log level is automatically reset when the daemon is restarted.
To make the change to log level of a daemon persistent, enter a command such as the following:
hadoop daemonlog -setlevel 10.250.1.15:50030 log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.resourcemanager DEBUG