[
https://issues.apache.org/jira/browse/LOG4J2-2897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17160175#comment-17160175
]
Kevin Grunenberg edited comment on LOG4J2-2897 at 7/17/20, 9:17 PM:
--------------------------------------------------------------------
I found a workaround by replacing
<<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
with
<CronTriggeringPolicy schedule="0 0 * * * ?" evaluateOnStartup="true"/>
was (Author: grunenbergk):
I found a workaround by replacing
<<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
with
<CronTriggeringPolicyschedule="0 0 * * * ?"evaluateOnStartup="true"/>
> Error creating rolling file with dated folder
> ---------------------------------------------
>
> Key: LOG4J2-2897
> URL: https://issues.apache.org/jira/browse/LOG4J2-2897
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.11.2
> Reporter: Kevin Grunenberg
> Priority: Major
> Labels: RollingFileAppender
>
> I am trying to use the rolling appender to create a new log file each day in
> a dated folder. The initial file creation works fine but when the rollover is
> triggered a FileNotFound exception is thrown.
>
> Config:
> **
> <Appenders>
> <RollingFile name="RollingFileAppender"
> filePattern="logDir/%d\{yyyyMMdd}/processor.log">
> <PatternLayout>
> <Pattern>%d [%t] %-5level %logger\{36}:%L -
> %msg%n%throwable</Pattern>
> </PatternLayout>
> <Policies>
> <!-- the logs get rolled over into a date named log file every
> day (filePattern)-->
> <TimeBasedTriggeringPolicyinterval="1"modulate="true"/>
> </Policies>
>
> <DirectWriteRolloverStrategy/>
> </RollingFile>
> </Appenders>
>
> looks like it could be an easy fix by adding a mkDirs call in
> createOutputStream() of FileManager class
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)