Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Rotate hadoop log file hourly with log4j

Highlighted

Rotate hadoop log file hourly with log4j

New Contributor

Hello Guys,
I am new to hadoop, I haven been given a task to rotate hadoop's applications log file on hourly basis with log4j config. I am using CentOS-7. I wrote an script but it is not doing anything and it is not giving any error.
I want to understand where is the classpath for log4j.properties. How to debug the script?

Here is the confi, i am using.Please let me know what wrong ,I am doing.

log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=${log.file}
log4j.appender.file.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.file.append=false
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n

2 REPLIES 2

Re: Rotate hadoop log file hourly with log4j

Mentor

@janvi 

 

Could you also share details of the version of your HDP  Cluster? And the path to the log4j.appender.file you shared?
ie Ambari UI, browse to HDFS > Configs > Advanced.

Highlighted

Re: Rotate hadoop log file hourly with log4j

New Contributor

Hello Shelton,

Thank for your reply, looking forward to your help.

 

version of my HDP  Cluster is HDP-2.6.0.3

Path to the log4j.appender.file is Ambari UI, browse to Zookeeper > Configs > Advanced>Advanced zookeeper-log4j

 

Don't have an account?
Coming from Hortonworks? Activate your account here