Hej!

Currently I try to configure log4j2 to:
* create a log in a folder with dates: e.h. 2020_04_27/messages.20200427_13_39_01.log
* limit the log size to 250MB
(* use a custom layout)
(* rollover every day)

But I'm already stuck with the first two bullets


```
appender.msglog.type = RollingFile
appender.msglog.name = localmsglog
appender.msglog.filePattern = /tmp/msg-${date:yyyy_MM_dd}/nps-message-${date:yyyy_MM_dd_HH_mm_ss}.log
appender.msglog.layout.type = log4j1xmllayout
appender.msglog.policies.type = Policies
appender.msglog.policies.size.type = SizeBasedTriggeringPolicy
appender.msglog.policies.size.size = 250MB
appender.msglog.strategy.type = DirectWriteRolloverStrategy
```
Basically the log is created in the correct folder and with the correct name. But the file is not rolled after 250MB .

I digged a little bit into the source and recognized that the `DirectWriteRolloverStrategy` does not get the pattern, but the current log file name, so it does not contain the `filePattern` at all.
Now I'm unsure if this is a bug or a configuration issue.

Thanks in advance
Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to