Created 07-21-2017 05:15 PM
Created 07-21-2017 05:21 PM
hdfs-audit and namenode log files are generated via log4j framework. Which is initialized at the time of component startup and creates the log file for writing or use the existing log file for writing in append mode. However if you delete these log files in the running mode of the components then the logging will not be reinitialized hence you will not see the new log file generated. This happens because the log4j appender will has a handle for the deleted file hence it will continue to write to it (which does not exist now because it is deleted), log4j will not detect that it has been deleted.
In custom applications we can make it happen by reinitializing the logging configuration via code, But existing components like NameNode does not control logging initialization/resetConfiguration at the code level.
org.apache.log4j.LogManager.resetConfiguration();
So you will need to restart the affected components (like NameNode in this case) to see the new files getting created.
Created 07-21-2017 05:21 PM
hdfs-audit and namenode log files are generated via log4j framework. Which is initialized at the time of component startup and creates the log file for writing or use the existing log file for writing in append mode. However if you delete these log files in the running mode of the components then the logging will not be reinitialized hence you will not see the new log file generated. This happens because the log4j appender will has a handle for the deleted file hence it will continue to write to it (which does not exist now because it is deleted), log4j will not detect that it has been deleted.
In custom applications we can make it happen by reinitializing the logging configuration via code, But existing components like NameNode does not control logging initialization/resetConfiguration at the code level.
org.apache.log4j.LogManager.resetConfiguration();
So you will need to restart the affected components (like NameNode in this case) to see the new files getting created.
Created 07-23-2017 08:08 AM
If this helped answering your query then it will be great if you mark this thread as "Answered" by clicking on the "Accepted" link, that way it will be helpful for HCC users to quickly find the answered threads.
Created 07-21-2017 11:56 PM
Thanks @Jay SenSharma for your suggestion. It worked fined after the reboot.
Created 07-23-2017 07:47 AM
#thank_you @Jay SenSharma sir