Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Master Guru

According to default Oozie log4j configuration in Ambari - Log get's rotated by every hour and retention is set to 30 days.

.

log4j.appender.oozie=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.oozie.RollingPolicy=org.apache.oozie.util.OozieRollingPolicy
log4j.appender.oozie.File=${oozie.log.dir}/oozie.log
log4j.appender.oozie.Append=true
log4j.appender.oozie.layout=org.apache.log4j.PatternLayout
log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n
# The FileNamePattern must end with "-%d{yyyy-MM-dd-HH}.gz" or "-%d{yyyy-MM-dd-HH}" and also start with the
# value of log4j.appender.oozie.File
log4j.appender.oozie.RollingPolicy.FileNamePattern=${log4j.appender.oozie.File}-%d{yyyy-MM-dd-HH}
# The MaxHistory controls how many log files will be retained (720 hours / 24 hours per day = 30 days); -1 to disable
log4j.appender.oozie.RollingPolicy.MaxHistory={{oozie_log_maxhistory}}

.

If you want to configure DRFA to roll the log file daily, please set below parameters in log4j section of Oozie configuration via Ambari and restart required services.

log4j.appender.oozie=org.apache.log4j.DailyRollingFileAppender 
log4j.appender.oozie.File=${oozie.log.dir}/oozie.log 
log4j.appender.oozie.Append=true 
log4j.appender.oozie.layout=org.apache.log4j.PatternLayout 
log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n 
log4j.appender.oozie.DatePattern='.'yyyy-MM-dd

.

Please note that DRFA does not support MaxBackupIndex hence if you want retention then you can go with RFA size based rolling and use MaxBackupIndex

.

Please comment if you have any feedback/questions/suggestions. Happy Hadooping!! :)

2,985 Views
Comments
avatar
New Member

Hello Kuldeep,

Can you let me know how to set log4j Property based on file size and MaxBackupIndex.

Thanks

Rakesh

Version history
Last update:
‎06-02-2017 12:01 AM
Updated by:
Contributors