[jira] [Updated] (LOG4J2-1878) Dates in filename for RollingRandomAccessFile appender

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LOG4J2-1878) Dates in filename for RollingRandomAccessFile appender

JIRA jira@apache.org

     [ 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: [hidden email]
For additional commands, e-mail: [hidden email]