You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2017/08/24 16:46:00 UTC

[jira] [Resolved] (LOG4J2-1928) RollingRandomAccessFileAppender with DirectWriteRolloverStrategy requires a fileName

     [ https://issues.apache.org/jira/browse/LOG4J2-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers resolved LOG4J2-1928.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.9

The fix for this has been committed. Please verify and close.

> RollingRandomAccessFileAppender with DirectWriteRolloverStrategy requires a fileName
> ------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1928
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1928
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.8.1
>            Reporter: Lucas Ventura Carro
>            Assignee: Ralph Goers
>             Fix For: 2.9
>
>
> Following the docs about [RollingRandomAccessFileAppender|https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingRandomAccessFileAppender] with a [DirectWrite rollover|https://logging.apache.org/log4j/2.x/manual/appenders.html#RolloverStrategies], the config should be:
> {code}
> <RollingRandomAccessFile append="true" filePattern="application.log.%i" name="json-log">
>     <filters>
>         <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
>     </filters>
> 	<PatternLayout>
> 		<Pattern>%m%n</Pattern>
> 	</PatternLayout>
>     <Policies>
>         <SizeBasedTriggeringPolicy size="10 MB"/>
>     </Policies>
>     <DirectWriteRolloverStrategy maxFiles="10"/>
> </RollingRandomAccessFile>
> {code}
> But then console shows:
> {noformat}
> 2017-06-01 14:31:04,396 main ERROR No filename was provided for FileAppender with name json-log
> 2017-06-01 14:31:04,406 main ERROR Null object returned for RollingRandomAccessFile in appenders.
> 2017-06-01 14:31:04,417 main ERROR Unable to locate appender "json-log" for logger config "root"
> {noformat}
> If adding a {{fileName}} parameter, the logger can be used but the file is not rolling (same as LOG4J2-1906).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)