@Pavel Orekhov
You can change the log level while logged on as hdfs with the below steps, you don't need to restart the namenode
Get the current log level
$ hadoop daemonlog -getlevel {namenode_host}:50070 BlockStateChange
Output
Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange
Submitted Log Name: BlockStateChange
Log Class: org.apache.commons.logging.impl.Log4JLogger
Effective Level: INFO
Change to DEBUG
$ hadoop daemonlog -setlevel {namenode_host}:50070 BlockStateChange DEBUG
Output
Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange&level=DEBUG
Submitted Log Name: BlockStateChange
Log Class: org.apache.commons.logging.impl.Log4JLogger
Submitted Level: DEBUG
Setting Level to DEBUG ...
Effective Level: DEBUG
Validate DEBUG mode
$ hadoop daemonlog -getlevel {namenode_host}:50070 BlockStateChange
Output
Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange
Submitted Log Name: BlockStateChange Log
Class: org.apache.commons.logging.impl.Log4JLogger
Effective Level: DEBUG
You should be able to notice the logging level in namenode.log has been updated, without restarting the service. After finishing your diagnostics you can reset the logging level back to INFO
Reset to INFO
$ hadoop daemonlog -setlevel {namenode_host}:50070 BlockStateChange INFO
Output
Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange&level=INFO
Submitted Log Name: BlockStateChange
Log Class: org.apache.commons.logging.impl.Log4JLogger
Submitted Level: INFO
Setting Level to INFO ...
Effective Level: INFO
Validate INFO
$ hadoop daemonlog -getlevel {namenode_host}:50070 BlockStateChange
Output
Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange
Submitted Log Name: BlockStateChange
Log Class: org.apache.commons.logging.impl.Log4JLogger
Effective Level: INFO
There you go
If you found this answer addressed your question, please take a moment to log in and click the "accept" link on the answer.