If you want both time and size then you need one %d pattern that reflects the
interval for when you want rotation to occur - namely _MM_dd. Normally you
would use %I in the pattern to increment a counter during the interval. But I
suspect if you use ${date} in the file name of the pattern an
Hi Ralph,
thanks for taking some time.
Basically I want a log which rotates at midnight and is limited in file
size. So I'd expect that these files are generated:
/2020_04_27/msg-2020_04_27-12_17_00.log (application started)
/2020_04_27/msg-2020_04_27-18_13_30.log (log file exceed 250MB)
/202
The %d pattern only applies to time based rollovers. If you want the time in a
size based rollover pattern then use the date lookup
filePattern=/tmp/msg-$${date:_MM_dd}/nps-message-$${date:_MM_dd_HH_mm_ss}.log
Ralph
> On Apr 27, 2020, at 10:39 AM, Benjamin Asbach wrote:
>
> I guess
I guess I've been glad to early.
```
appender.msglog.type = RollingFile
appender.msglog.name = localmsglog
appender.msglog.filePattern =
/tmp/msg-%d{_MM_dd}/nps-message-%d{_MM_dd_HH_mm_ss}.log
appender.msglog.layout.type = log4j1xmllayout
appender.msglog.policies.type = Policies
appende
I guess I found a solution:
```
appender.msglog.type = RollingFile
appender.msglog.name = localmsglog
appender.msglog.filePattern =
/tmp/msg-%d{_MM_dd}/nps-message-%d{_MM_dd_HH_mm_ss}.log
appender.msglog.layout.type = log4j1xmllayout
appender.msglog.policies.type = Policies
appender.msg
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 = RollingF