Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar

Below properties can be used to configure the log4j settings for size based compressed backup.

Here is an example for Hive service.

log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
log4j.appender.DRFA=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.DRFA.rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy  
log4j.appender.DRFA.triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy  
log4j.appender.DRFA.rollingPolicy.ActiveFileName =${hive.log.dir}/${hive.log.file}.log
log4j.appender.DRFA.rollingPolicy.FileNamePattern=${hive.log.dir}/${hive.log.file}-.%i.log.gz
log4j.appender.DRFA.triggeringPolicy.MaxFileSize=10000
log4j.appender.DRFA.rollingPolicy.maxIndex=10

For some reason maxfilesize is not working if used like 1MB like that - so use live above.

Note: please check console log (.out or .err) for any WARNINGS if does not work

5,427 Views
Comments
avatar

Hi Amarnath,


Will this work for Oozie? If not do you have similar log4j setting for oozie?


Thanks,

Sajin