From the web site - If you don't want compression remove .gz from the 
filePattern.

<?xml version="1.0" encoding="UTF-8"?>
<configuration status="warn" name="MyApp" packages="">
  <appenders>
    <RollingFile name="RollingFile" fileName="logs/app.log"
                 
filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
      <PatternLayout>
        <pattern>%d %p %c{1.} [%t] %m%n</pattern>
      </PatternLayout>
      <Policies>
        <TimeBasedTriggeringPolicy />
        <SizeBasedTriggeringPolicy size="250 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="20"/>
    </RollingFile>
  </appenders>
  <loggers>
    <root level="error">
      <appender-ref ref="RollingFile"/>
    </root>
  </loggers>
</configuration>




On Sep 3, 2013, at 1:50 AM, Alexei Pomelov wrote:

> Hello!
> 
> I'm migrating from proprietary logging backend to the Log4j and failed to
> configure the same behavior.
> 
> I need to configure appender that will create log files with these three
> requirements:
>  -- log file name: "application_%d{yyyyMMddHHmmss}.log"
>  -- limit maximum log file size
>  -- limit maximum number of files
> 
> I've already tried a lot of configurations, but could satisfy only two
> requirements of three :(
> Is it possible without patching the appender itself?
> 
> Thanks!
> 
>  Regards, Alexey

Reply via email to