You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "tony (Jira)" <ji...@apache.org> on 2021/07/20 04:03:00 UTC

[jira] [Updated] (LOG4J2-3126) file permissions doesn't work on RollingRandomAccessFile appender

     [ https://issues.apache.org/jira/browse/LOG4J2-3126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

tony updated LOG4J2-3126:
-------------------------
    Attachment: Screen Shot 2021-07-19 at 8.51.29 PM.png

> file permissions doesn't work on RollingRandomAccessFile appender
> -----------------------------------------------------------------
>
>                 Key: LOG4J2-3126
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3126
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.11.1
>            Reporter: tony
>            Priority: Major
>         Attachments: Screen Shot 2021-07-19 at 8.51.29 PM.png
>
>
> 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) 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.
> !Screen Shot 2021-07-19 at 8.51.29 PM.png!
> my configuration for the appender is below:
>  
> {code:java}
> <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>
> {code}
> my question is, why is there only file has a 750 permission, am I using the correct configuration or is this a bug? thanks.
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)