Strange default Rolling + Delete setup for Log4j

7 views
Skip to first unread message

Petr Bodnár

unread,
May 25, 2021, 1:02:18 PM5/25/21
to CAS Community
Hi,

I'm a bit confused about the current contents of the default log4j2.xml. So before making a pull request, I will rather ask here...

In rfeea2ae7cad65, the DefaultRolloverStrategy with a nested Delete element was added to every file appender. So far so good. But what I don't quite understand, resp. what doesn't work for me:

1) Purpose of `compressionLevel`. According to Log4j documentation, this only applies when "zip" format compression is activated, so this attribute seems useless.

2) Pattern for Delete is set to "*/*.log.gz", but filePattern doesn't seem to enforce any kind of compression, it always ends just with ".log". So when there is no compression happening, no files can be actually deleted?

3) (Subjective) The default time-range for rolling is set to hours (`HH`) - is this really practical for most deployments? Wouldn't it suffice to use just days (`DD`)?

4) Lastly, there is also an example log4j2.xml in the officially recommended overlay template. I wonder which of these 2 xml files should be updated then? There doesn't seem to be an ongoing synchronization of these files in the recent years...
Reply all
Reply to author
Forward
0 new messages