You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Seweryn Habdank-Wojewodzki (JIRA)" <ji...@apache.org> on 2017/11/16 08:42:00 UTC

[jira] [Updated] (LOG4J2-2121) DefaultRolloverStrategy max = 5 does not limit nuber of files

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

Seweryn Habdank-Wojewodzki updated LOG4J2-2121:
-----------------------------------------------
    Description: 
Dears,

I have very simple configuration of the RollingFile appender


{code:xml}
<RollingFile name="RollingFile" fileName="${env:LOG_DIR}/${application}/endpoint.log"
                 filePattern="$${env:LOG_DIR}/$${application}/$${date:yyyy-MM}/endpoint-%d{yyyy-MM-dd}-%i.log">
      <PatternLayout>
        <Pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n</Pattern>
      </PatternLayout>
      <Policies>
        <TimeBasedTriggeringPolicy />
      </Policies>
      <DefaultRolloverStrategy max="5"/>
    </RollingFile>
{code}

This configuration works partly good. Every day there is created file in folder _YYYY-MM_.
That is expected.
What is not expected - it is that the process is not limited at all. I mean there are more than 5 files in all folders.

Questions: 
Is it something wrong with configuration?
is max=5 considered to be the numeber of files or folders (in my case months)?
or max=5 is ignored at all.

Thanks in advance for help.

  was:
Dears,

I have very simple configuration of the RollingFile appender

{{    <RollingFile name="RollingFile" fileName="${env:LOG_DIR}/${application}/endpoint.log"
                 filePattern="$${env:LOG_DIR}/$${application}/$${date:yyyy-MM}/endpoint-%d{yyyy-MM-dd}-%i.log">
      <PatternLayout>
        <Pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n</Pattern>
      </PatternLayout>
      <Policies>
        <TimeBasedTriggeringPolicy />
      </Policies>
      <DefaultRolloverStrategy max="5"/>
    </RollingFile>
}}

This configuration works partly good. Every day there is created file in folder _YYYY-MM_.
That is expected.
What is not expected - it is that the process is not limited at all. I mean there are more than 5 files in all folders.

Questions: 
Is it something wrong with configuration?
is max=5 considered to be the numeber of files or folders (in my case months)?
or max=5 is ignored at all.

Thanks in advance for help.


> DefaultRolloverStrategy max = 5 does not limit nuber of files
> -------------------------------------------------------------
>
>                 Key: LOG4J2-2121
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2121
>             Project: Log4j 2
>          Issue Type: Question
>         Environment: Linux RedHat
>            Reporter: Seweryn Habdank-Wojewodzki
>
> Dears,
> I have very simple configuration of the RollingFile appender
> {code:xml}
> <RollingFile name="RollingFile" fileName="${env:LOG_DIR}/${application}/endpoint.log"
>                  filePattern="$${env:LOG_DIR}/$${application}/$${date:yyyy-MM}/endpoint-%d{yyyy-MM-dd}-%i.log">
>       <PatternLayout>
>         <Pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n</Pattern>
>       </PatternLayout>
>       <Policies>
>         <TimeBasedTriggeringPolicy />
>       </Policies>
>       <DefaultRolloverStrategy max="5"/>
>     </RollingFile>
> {code}
> This configuration works partly good. Every day there is created file in folder _YYYY-MM_.
> That is expected.
> What is not expected - it is that the process is not limited at all. I mean there are more than 5 files in all folders.
> Questions: 
> Is it something wrong with configuration?
> is max=5 considered to be the numeber of files or folders (in my case months)?
> or max=5 is ignored at all.
> Thanks in advance for help.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)