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">
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        <RollingFile name="RollingFile" fileName="logs/app.log" filePattern="logs/app-%d{MM-dd-yyyy}.log.gz"
                <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
            <TimeBasedTriggeringPolicy />
        <Failover name="Failover" primary="RollingFile">
                <AppenderRef ref="Console"/>
        <Root level="error">
            <AppenderRef ref="RollingFile"/>

I am still seeing errors with this. 

2017-07-10 16:43:17,201 main ERROR appender Failover has no parameter that matches element
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
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. 
>(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
View raw message