Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Enable Oozie error log

avatar
Rising Star

Hi Team,

I need to enable Oozie error lot which is not done before. Can you let me know the process of doing it. I see few jobs are in RUNNING state in COORDINATOR JOBS. Let me know how to enable Error log without affecting the jobs

1 ACCEPTED SOLUTION

avatar
Master Guru

@suresh krish

Unfortunately you cannot do it without restarting Oozie

Here are the steps:

1. Add the below set of lines after log4j.appender.oozie and before log4j.appender.oozieops:

log4j.appender.oozieError=org.apache.log4j.rolling.RollingFileAppender 
log4j.appender.oozieError.RollingPolicy=org.apache.oozie.util.OozieRollingPolicy 
log4j.appender.oozieError.File=${oozie.log.dir}/oozie-error.log 
log4j.appender.oozieError.Append=true 
log4j.appender.oozieError.layout=org.apache.log4j.PatternLayout 
log4j.appender.oozieError.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n 
log4j.appender.oozieError.RollingPolicy.FileNamePattern=${log4j.appender.oozieError.File}-%d{yyyy-MM-dd-HH} 
log4j.appender.oozieError.RollingPolicy.MaxHistory=720 
log4j.appender.oozieError.filter.1 = org.apache.log4j.varia.LevelMatchFilter 
log4j.appender.oozieError.filter.1.levelToMatch = WARN 
log4j.appender.oozieError.filter.2 = org.apache.log4j.varia.LevelMatchFilter 
log4j.appender.oozieError.filter.2.levelToMatch = ERROR 
log4j.appender.oozieError.filter.3 = org.apache.log4j.varia.LevelMatchFilter 
log4j.appender.oozieError.filter.3.levelToMatch = FATAL 
log4j.appender.oozieError.filter.4 = org.apache.log4j.varia.DenyAllFilter 
2. Modify below props:

Earlier value:

log4j.logger.org.apache.oozie=WARN, oozie 

New value:

log4j.logger.org.apache.oozie=ALL, oozie, oozieError 
3. Restart Oozie service via Ambari.

Note - This would help in getting the job error log for the new jobs launched after restart of oozie service.

View solution in original post

3 REPLIES 3

avatar
Master Guru

@suresh krish

Unfortunately you cannot do it without restarting Oozie

Here are the steps:

1. Add the below set of lines after log4j.appender.oozie and before log4j.appender.oozieops:

log4j.appender.oozieError=org.apache.log4j.rolling.RollingFileAppender 
log4j.appender.oozieError.RollingPolicy=org.apache.oozie.util.OozieRollingPolicy 
log4j.appender.oozieError.File=${oozie.log.dir}/oozie-error.log 
log4j.appender.oozieError.Append=true 
log4j.appender.oozieError.layout=org.apache.log4j.PatternLayout 
log4j.appender.oozieError.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n 
log4j.appender.oozieError.RollingPolicy.FileNamePattern=${log4j.appender.oozieError.File}-%d{yyyy-MM-dd-HH} 
log4j.appender.oozieError.RollingPolicy.MaxHistory=720 
log4j.appender.oozieError.filter.1 = org.apache.log4j.varia.LevelMatchFilter 
log4j.appender.oozieError.filter.1.levelToMatch = WARN 
log4j.appender.oozieError.filter.2 = org.apache.log4j.varia.LevelMatchFilter 
log4j.appender.oozieError.filter.2.levelToMatch = ERROR 
log4j.appender.oozieError.filter.3 = org.apache.log4j.varia.LevelMatchFilter 
log4j.appender.oozieError.filter.3.levelToMatch = FATAL 
log4j.appender.oozieError.filter.4 = org.apache.log4j.varia.DenyAllFilter 
2. Modify below props:

Earlier value:

log4j.logger.org.apache.oozie=WARN, oozie 

New value:

log4j.logger.org.apache.oozie=ALL, oozie, oozieError 
3. Restart Oozie service via Ambari.

Note - This would help in getting the job error log for the new jobs launched after restart of oozie service.

avatar
Explorer

@suresh krish , @Kuldeep Kulkarni what is the file in which i have to make these changes . Is it possible to change oozie configuration for shell action by passing these parameters as a log4j.propreties in the configuration tag of the oozie shell action ?

avatar
New Contributor

https://stackoverflow.com/questions/40405538/how-to-enable-setup-log4j-for-oozi-java-workflows

This tells that you can try adding oozie-log4j.properties in your oozie directory (where workflow.xml is).