mariusv5 opened a new issue, #1258:
URL: https://github.com/apache/logging-log4j2/issues/1258

   ## Description
   
   I use the Apache Tomcat.
   We have configured the log4j2 Java Options Arguments: 
-Dlog4j.configurationFile={/path1}/log4j2.xml,{/path2}/log4j2.xml.
   The two files are related one for Web Application and the other for 
WebServices (so the JDK is the same), on startup the logs collected are:
   
   > ll wss_*
   -rw-r----- 1 root mf      0  1 feb 12.55 wss_alarms.log
   -rw-r----- 1 root mf   5368  1 feb 12.55 wss_axis.log
   -rw-r----- 1 root mf   1082  1 feb 12.55 wss_database.log
   -rw-r----- 1 root mf 123172  1 feb 13.12 wss_main.log
   -rw-r----- 1 root mf      0  1 feb 12.55 wss_warrants.log
   -rw-r----- 1 root mf      0  1 feb 12.55 wss_wfa.log
   
   > ll webapp_*
   -rw-r----- 1 root mf 8172  1 feb 13.13 webapp_actions.log
   -rw-r----- 1 root mf  176  1 feb 12.55 webapp_database.log
   -rw-r----- 1 root mf    0  1 feb 12.55 webapp_grids.log
   -rw-r----- 1 root mf    0  1 feb 12.55 webapp_json.log
   -rw-r----- 1 root mf 4796  1 feb 12.55 webapp_struts.log
   
   I use the DefaultRolloverStrategy max="5", with the number of retention 
days, below is an example:
   
   > <Properties>
        <Property name="service-suffix-wss">wss</Property>
        <Property name="log-path-wss">/home/logs</Property>
        <Property name="retention-days-wss">5</Property>
   </Properties>
   
   <RollingFile name="RollingAlarms" 
fileName="${log-path-wss}/${service-suffix-wss}_alarms.log" append="true" 
filePattern="${log-path-wss}/${service-suffix-wss}_alarms-%d{yyyy-MM-dd}-%i.log">
        <PatternLayout pattern="%d %5p (%F:%L) %m%n" />
   
        <Policies>
                <OnStartupTriggeringPolicy />
                <SizeBasedTriggeringPolicy size="50 MB" />
                <CronTriggeringPolicy schedule="0 0 0 * * ?" />
        </Policies>
   
        <DefaultRolloverStrategy max="${retention-days-wss}">
                <Delete basePath="${log-path-wss}" maxDepth="1">
                        <IfFileName glob="${service-suffix-wss}_alarms-*.log" />
                        <IfLastModified age="${retention-days-wss}d" />
                </Delete>
        </DefaultRolloverStrategy>
   </RollingFile>
   
   The problem is that in after the file rolling, no more log are produced and 
the rotated file stays at zero length:
   
   > -rw-r--r-- 1 root mf   92521 31 gen 23.59 wss_wfa-2023-01-31-1.log
   -rw-r--r-- 1 root mf       0  1 feb 00.00 wss_wfa.log
   
   ## Configuration
   
   **Operating system:**
   - Red Hat Enterprise Linux Server release 7.2 
   
   **Application server:**
   - apache-tomcat-8.5.9
   
   **Log4j2 Version:**
   - log4j-api-2.17.1.jar
   - log4j-core-2.17.1.jar
   
   **JDK:**
   - JDK 1.8.0_301
   
   ## Logs
   
   No logs
   
   ## Reproduction
   
   Configure tomcat with two different log4j2.xml file and different 
attributes, when log4j start rolling, the lines log not add in the new file and 
no more log are produced.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to