You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2022/09/09 15:29:00 UTC

[jira] [Commented] (LOG4J2-3591) daily log rotate not working on my tomcat server for catalina.log

    [ https://issues.apache.org/jira/browse/LOG4J2-3591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17602421#comment-17602421 ] 

Ralph Goers commented on LOG4J2-3591:
-------------------------------------

I don't see anything obviously wrong with your configuration. Can you change the status level from info to debug and provide us the status logs from around midnight when the rollover should occur?

> daily log rotate not working on my tomcat server for catalina.log
> -----------------------------------------------------------------
>
>                 Key: LOG4J2-3591
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3591
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.17.0
>            Reporter: mohamed omar sheriff
>            Priority: Critical
>
> on my tomcat server only daily log rotate is not working,  logs are recorded on the same catalina.log file.   SizeBasedTriggeringPolicy and OnStartupTriggeringPolicy is working as expected.
> below are the log4j2-tomcat.xml file trace
> <?xml version="1.0" encoding="utf-8"?>
> <Configuration status="info">
>     <Properties>
>         <Property name="logdir">${sys:catalina.base}/logs</Property>
>         <Property name="layout">TOMCAT %d [%t] %-5p %c- %m%n</Property>
>     </Properties>
>     <Appenders>
>         <RollingFile name="CATALINA" fileName="${logdir}/catalina.log" filePattern="${logdir}/catalina.%d\{yyyy-MM-dd}-%i.log">
>             <PatternLayout pattern="${layout}"/>
>             <Policies>
>                 *<TimeBasedTriggeringPolicy interval="1" modulate="true"/>*
>                 <SizeBasedTriggeringPolicy size="5MB"/>
>                 <OnStartupTriggeringPolicy />
>             </Policies>
>             <DefaultRolloverStrategy max="30"/>
>         </RollingFile>
>     </Appenders>
>     <Loggers>
>         <Root level="INFO">
>             <AppenderRef ref="CATALINA"/>
>         </Root>
>         <Logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="info" additivity="false">
>             <AppenderRef ref="CATALINA"/>
>         </Logger>
>     </Loggers>
> </Configuration>



--
This message was sent by Atlassian Jira
(v8.20.10#820010)