logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan Loman (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4J2-1878) Dates in filename for RollingRandomAccessFile appender
Date Wed, 12 Apr 2017 01:48:41 GMT

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

Juan Loman updated LOG4J2-1878:
-------------------------------
    Description: 
The feature for using dates as part of the current logfile (by omitting the filename attribute
and using the filepattern instead) has been implemented for {{RollingFileAppender}} (see LOG4J2-1101)
but not for {{RollingRandomAccessFileAppender}}.

The following config should work:
{code:xml}
<RollingRandomAccessFile name="Application" filePattern="logs/test.%d{yyyy-MM-dd-HH-mm}.log">
    <PatternLayout pattern="%d{DATE} [%p] %X{RequestId} (%t) %c: %m%n"/>
    <Policies>
        <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
    </Policies>
    <DirectWriteRolloverStrategy/>
</RollingRandomAccessFile>
{code}

Currently it emits {code}ERROR No filename was provided for FileAppender with name Application{code}

  was:
The feature for using dates as part of the current logfile (by omitting the filename attribute
and using the filepattern instead) has been implemented for {{RollingFileAppender}} but not
for {{RollingRandomAccessFileAppender}}.

The following config should work:
{code:xml}
<RollingRandomAccessFile name="Application" filePattern="logs/test.%d{yyyy-MM-dd-HH-mm}.log">
    <PatternLayout pattern="%d{DATE} [%p] %X{RequestId} (%t) %c: %m%n"/>
    <Policies>
        <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
    </Policies>
    <DirectWriteRolloverStrategy/>
</RollingRandomAccessFile>
{code}

Currently it emits {code}ERROR No filename was provided for FileAppender with name Application{code}


> Dates in filename for RollingRandomAccessFile appender
> ------------------------------------------------------
>
>                 Key: LOG4J2-1878
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1878
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>            Reporter: Juan Loman
>
> The feature for using dates as part of the current logfile (by omitting the filename
attribute and using the filepattern instead) has been implemented for {{RollingFileAppender}}
(see LOG4J2-1101) but not for {{RollingRandomAccessFileAppender}}.
> The following config should work:
> {code:xml}
> <RollingRandomAccessFile name="Application" filePattern="logs/test.%d{yyyy-MM-dd-HH-mm}.log">
>     <PatternLayout pattern="%d{DATE} [%p] %X{RequestId} (%t) %c: %m%n"/>
>     <Policies>
>         <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
>     </Policies>
>     <DirectWriteRolloverStrategy/>
> </RollingRandomAccessFile>
> {code}
> Currently it emits {code}ERROR No filename was provided for FileAppender with name Application{code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message