You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Apache <ra...@dslextreme.com> on 2017/11/16 13:58:25 UTC
Re: [jira] [Updated] (LOG4J2-2121) DefaultRolloverStrategy max = 5 does not limit nuber of files
From your configuration the limit is 5 per rollover interval. You are specifying an interval of one day. Are you getting more than 5 per day?
Ralph
> On Nov 16, 2017, at 1:44 AM, Seweryn Habdank-Wojewodzki (JIRA) <ji...@apache.org> wrote:
>
>
> [ 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.
>
> I had read some hints in: [How does Log4j2 DefaultRolloverStrategy's max attribute really work?|https://stackoverflow.com/questions/24551768/how-does-log4j2-defaultrolloverstrategys-max-attribute-really-work]
>
> Thanks in advance for help.
>
> was:
> 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.
>
>
>> 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.
>> I had read some hints in: [How does Log4j2 DefaultRolloverStrategy's max attribute really work?|https://stackoverflow.com/questions/24551768/how-does-log4j2-defaultrolloverstrategys-max-attribute-really-work]
>> Thanks in advance for help.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.4.14#64029)
>