Community Articles
Find and share helpful community-sourced technical articles
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)

Often the namenode log files grow in size and they have too many kinds of messages. One of the most commonly faced scenario is where there had been multiple state changes in hdfs and investigating them becomes a pain when there are multiple occurrence in huge log files.

Luckily there is a very easy way to make a few configuration changes to ensure that state change log statements get logged to a separate file.

To isolate and log state change log messages to another file, add the following to hdfs-log4j and restart the namenodes.

You can make this change from Ambari.

Ambari > HDFS service > Configs tab > Advanced tab > Advanced hdfs-log4j section > hdfs-log4j template

# StateChange log,SCL 
log4j.appender.SCL.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n 

In this way, HDFS StateChange log messages will be written in ${hadoop.log.dir}/hdfs-state-change.log
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎09-14-2017 04:04 AM
Updated by:
Top Kudoed Authors