You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Lucas Ventura Carro (JIRA)" <ji...@apache.org> on 2017/06/01 13:33:04 UTC

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

Lucas Ventura Carro created LOG4J2-1928:
-------------------------------------------

             Summary: 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


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}

Later, the file is not rolling, the same as LOG4J2-1906.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)