Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.11.1
-
None
-
None
Description
I'm using a RollingRandomAccessFile appender in my log4j2 config, I want the log file has permission 750(rwxr-x---), but only the first log file(the one that gets created when application starts up) has permission 750, all the new log file after rolling over still has a default permission, as you can see in the image below, server.log.1 has permission 750, which is the very first server.log that gets renamed to server.log.1, all the other files have a default permission.
my configuration for the appender is below:
<RollingRandomAccessFile name="testlog" fileName="${LOG_DIR}/server.log" filePattern="${LOG_DIR}/server.log.%i" filePermissions="rwxr-x---" append="true" > <PatternLayout> <Pattern>some random pattern that I don't want to show here</Pattern> </PatternLayout> <Policies> <SizeBasedTriggeringPolicy size="10 KB" /> </Policies> <DefaultRolloverStrategy max="7"/> </RollingRandomAccessFile>
It looks like log4j2 sets permission correctly on startup, but doesn't set permission when rolling over log files, am I using the correct configuration or is this a bug? thanks.