logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vina Martin <vina.mar...@connexta.com>
Subject Re: FailoverAppender is not starting
Date Mon, 10 Jul 2017 23:48:48 GMT
So instead of what I had, it should be configured like this? 

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
        <RollingFile name="RollingFile" fileName="logs/app.log" filePattern="logs/app-%d{MM-dd-yyyy}.log.gz"
                     ignoreExceptions="false">
            <PatternLayout>
                <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
            </PatternLayout>
            <TimeBasedTriggeringPolicy />
        </RollingFile>
        <Failover name="Failover" primary="RollingFile">
            <Failovers>
                <AppenderRef ref="Console"/>
            </Failovers>
        </Failover>
    </Appenders>
    <Loggers>
        <Root level="error">
            <AppenderRef ref="RollingFile"/>
        </Root>
    </Loggers>
</Configuration>


I am still seeing errors with this. 

2017-07-10 16:43:17,201 main ERROR appender Failover has no parameter that matches element
Failovers
2017-07-10 16:43:17,202 main ERROR Null object returned for RollingFile in Appenders.
2017-07-10 16:43:17,207 main ERROR Unable to locate appender "RollingFile" for logger config
"root"
2017-07-10 16:43:17,208 main ERROR Unable to locate primary Appender RollingFile



I am using this as reference: https://logging.apache.org/log4j/2.0/manual/appenders.html#FailoverAppender



On 7/10/17, 3:58 PM, "Remko Popma" <remko.popma@gmail.com> wrote:

>Your root logger is referencing the Failover appender directly. It should reference the
RollingFile appender instead. 
>
>Remko
>
>(Shameless plug) Every java main() method deserves http://picocli.info
>
>> On Jul 11, 2017, at 4:20, Vina Martin <vina.martin@connexta.com> wrote:
>> 
>> RollingFile
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
Mime
View raw message