[
https://issues.apache.org/jira/browse/LOG4J2-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Deepak Khobragade updated LOG4J2-2014:
--------------------------------------
Priority: Critical (was: Major)
Issue Type: Bug (was: Question)
> How to configure a Failover appender for a RollingFile Appender which is
> inside a RoutingAppender?
> --------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-2014
> URL: https://issues.apache.org/jira/browse/LOG4J2-2014
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.8.2
> Environment: Operating System : Centos7
> Tomcat Version : 7.5
> Reporter: Deepak Khobragade
> Priority: Critical
> Fix For: 2.8.2
>
>
> I am using RoutingAppender to create log files dynamically, hence inside the
> RollingFile Appenders are nested inside the RoutingAppenders. Now I need to
> configure a FailoverAppender for the nested RoutingAppender.
> This is what configuration looks like:
> {code:xml}
> <Routing name="AuditLogRouting">
> <Routes pattern="$${ctx:ROUTINGKEY}">
> <Route>
> <Failover name="AUDIT_LOG_FAILOVER" primary="Rolling-${ctx:ROUTINGKEY}">
> <Failovers>
> <AppenderRef ref="DRFILE" />
> </Failovers>
> </Failover>
> <RollingFile name="Rolling-${ctx:ROUTINGKEY}"
> fileName="${sys:catalina.base}/logs/${ctx:ROUTINGKEY}.log"
>
> filePattern="${sys:catalina.base}/logs/${ctx:ROUTINGKEY}-%d{yyyyMMdd}.log.gz"
> immediateFlush="true">
> <PatternLayout>
> <pattern>%m%n</pattern>
> </PatternLayout>
> <Policies>
> <TimeBasedTriggeringPolicy interval="1"
> modulate="true" />
> </Policies>
> </RollingFile>
> </Route>
> </Routes>
> </Routing>
> {code}
> If I try to put the FailoverAppender inside the RoutingAppender, I get an
> error that the FailoverAppender is not initialized. I need to know how do I
> configure the Failover appender for the RollingFileAppender nested inside the
> RoutingAppender.
> Thanks!
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)