I am also facing similar issue. log file compression never worked for me. i am 
using version 2.2
below is the configuration
<RollingRandomAccessFile name="Common" append="false" 
fileName="${logdir}\\Common\\common.log" 
filePattern="${logdir}\\Common\\$${date:yyyy-MM}\\common-%d{MM-dd-yyyy}-%i.log.gz">
      <PatternLayout pattern="${layout}"/>      <Policies>        
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>        
<SizeBasedTriggeringPolicy size="1 MB"/>      </Policies>      
<DefaultRolloverStrategy max="10"/>    </RollingRandomAccessFile>
Any pointer?
Regards,Mangat Rai


> Date: Tue, 24 Mar 2015 16:42:15 +0200
> Subject: Re: Intermittent log file compression issue
> From: [email protected]
> To: [email protected]
> 
> Hi Remko,
> 
> Thanks, very much.
> Changing FilePattern to filePattern did not solve the issue.
> The * was an typeo in the email, sorry for that.
> 
> I am still experiencing the same issue inside the container and I can't
> recreate the issue with the same log4j2.xml outside the container.
> 
> Next step is to check the log4j2 fine logs and I will report back.
> 
> Regards,
> Richard.
> Can you try filePattern with a lower-case 'f' and remove the '*' characters
> from the filePattern path?
> 
> For example:
> > FilePattern="
> > *logs/$${date:yyyy-MM}/fault-%d{yyyy-MM-dd_hh_mm}-%i.log.gz*"
> 
> 
> Should be
> > filePattern="
> > logs/$${date:yyyy-MM}/fault-%d{yyyy-MM-dd_hh_mm}-%i.log.gz"
> 
> 
> Regards,
> Remko
> 
> Sent from my iPhone
> 
> > On 2015/03/24, at 17:12, Richard Kolb <[email protected]> wrote:
> >
> > Hello,
> >
> > I am using log4j 2.2 on Windows 2008 using Java 7 and I'm experiencing an
> > intermittent issue where my log files used to compress, but now just move
> > to the archive directory uncompressed.
> >
> > To debug, I changed the file pattern to be on the minute level (in bold),
> > and I am getting the same issue
> >
> > Any help would be greatly be appreciated..
> >
> > thanks,
> > Richard.
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <Configuration status="TRACE" name="API" packages=""
> monitorInterval="30">
> >    <Appenders>
> >    <RollingRandomAccessFile name="CatchAll" fileName="logs/all.log"
> > immediateFlush="false" append="true"
> > FilePattern="logs/$${date:yyyy-MM}/all-%d{yyyy-MM-dd}-%i.log.gz">
> >      <PatternLayout>
> >        <Pattern>%d %m%n</Pattern>
> >      </PatternLayout>
> >            <Policies>
> >                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
> >                <SizeBasedTriggeringPolicy size="2 GB"/>
> >            </Policies>
> >            <DefaultRolloverStrategy max="20"/>
> >    </RollingRandomAccessFile>
> >    <RollingRandomAccessFile name="Audit" fileName="logs/audit.log"
> > immediateFlush="false" append="true"
> > FilePattern="logs/$${date:yyyy-MM}/audit-%d{yyyy-MM-dd_hh_mm}-%i.log.gz">
> >      <PatternLayout>
> >        <Pattern>%d %m%n</Pattern>
> >      </PatternLayout>
> >            <Policies>
> >                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
> >                <SizeBasedTriggeringPolicy size="2 GB"/>
> >            </Policies>
> >            <DefaultRolloverStrategy max="20"/>
> >    </RollingRandomAccessFile>
> >    <RollingRandomAccessFile name="Fault" fileName="logs/fault.log"
> > immediateFlush="false" append="true" FilePattern="
> > *logs/$${date:yyyy-MM}/fault-%d{yyyy-MM-dd_hh_mm}-%i.log.gz*">
> >      <PatternLayout>
> >        <Pattern>%d %m%n</Pattern>
> >      </PatternLayout>
> >            <Policies>
> >                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
> >                <SizeBasedTriggeringPolicy size="2 GB"/>
> >            </Policies>
> >            <DefaultRolloverStrategy max="20"/>
> >    </RollingRandomAccessFile>
> >
> >
> >   <RollingRandomAccessFile name="LegacyAudit"
> > fileName="logs/webservices.log" immediateFlush="false" append="true"
> > FilePattern="
> > *logs/$${date:yyyy-MM}/webservices-%d{yyyy-MM-dd_hh_mm}-%i.log.gz*">
> >      <PatternLayout>
> >        <Pattern>%d %m%n</Pattern>
> >      </PatternLayout>
> >            <Policies>
> >                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
> >                <SizeBasedTriggeringPolicy size="2 GB"/>
> >            </Policies>
> >            <DefaultRolloverStrategy max="20"/>
> >    </RollingRandomAccessFile>
> >
> >
> >
> >    </Appenders>
> > <!-- Don't forget to set system property for Async
> >
> -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
> >     to make all loggers asynchronous. -->
> >    <Loggers>
> >        <Logger name="x.FcapsInterceptor" level="trace">
> >            <AppenderRef ref="Audit"/>
> >        </Logger>
> >        <Logger name="x.FcapsRpcInterceptor" level="trace">
> >            <AppenderRef ref="*LegacyAudit*"/>
> >        </Logger>
> >
> >       <Logger name="x.Fault" level="trace">
> >            <AppenderRef ref="*Fault*"/>
> >        </Logger>
> >    <!--Root level="trace">
> >      <AppenderRef ref="CatchAll"/>
> >    </Root-->
> >    </Loggers>
> > </Configuration>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
                                          

Reply via email to