Aitor Gonzalez
Aitor Gonzalez

Reputation: 125

Log4java zip compression issue: All file appenders are the same but compression only works for some of them

how are you?

I have some issues with Log4Java configuration. I want to compress in zip all the files daily. All the file appenders are configured in the same way except for the file names, the file paths and the appender names. But, compression is only working on some of the files (on our test server) and on one file in our production server.

We are using org.apache.log4j.rolling.RollingFileAppender from apache-log4j-extras-1.2.17.jar and log4j-1.2.17.jar.

This is one example of our configuration, from an appender that works and an appender that doesn't work.

The appender that works:

log4j.appender.A_WS_CETELEM=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.A_WS_CETELEM.File=\\\\10.5.128.23\\DocumentosFico\\Stofi_Logs\\log_ws_CETELEM.log
log4j.appender.A_WS_CETELEM.ImmediateFlush=true
log4j.appender.A_WS_CETELEM.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.A_WS_CETELEM.RollingPolicy.ActiveFileName=\\\\10.5.128.23\\DocumentosFico\\Stofi_Logs\\log_ws_CETELEM.log
log4j.appender.A_WS_CETELEM.RollingPolicy.FileNamePattern=\\\\10.5.128.23\\DocumentosFico\\Stofi_Logs\\log_ws_CETELEM.%d{yyyyMMdd}.zip
log4j.appender.A_WS_CETELEM.Encoding=ISO-8859-1
log4j.appender.A_WS_CETELEM.layout=org.apache.log4j.PatternLayout
log4j.appender.A_WS_CETELEM.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - %m%n
log4j.appender.A_WS_CETELEM.append=true
log4j.logger.log_ws_CETELEM=DEBUG,A_WS_CETELEM

And one that doesn't work:

log4j.appender.A_INTERFACES_ADSI=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.A_INTERFACES_ADSI.File=\\\\10.5.128.23\\DocumentosFico\\Stofi_Logs\\log_Interfaces_ADSI.log
log4j.appender.A_INTERFACES_ADSI.ImmediateFlush=true
log4j.appender.A_INTERFACES_ADSI.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.A_INTERFACES_ADSI.RollingPolicy.ActiveFileName=\\\\10.5.128.23\\DocumentosFico\\Stofi_Logs\\log_Interfaces_ADSI.log
log4j.appender.A_INTERFACES_ADSI.RollingPolicy.FileNamePattern=\\\\10.5.128.23\\DocumentosFico\\Stofi_Logs\\log_Interfaces_ADSI.%d{yyyyMMdd}.zip
log4j.appender.A_INTERFACES_ADSI.Encoding=ISO-8859-1
log4j.appender.A_INTERFACES_ADSI.layout=org.apache.log4j.PatternLayout
log4j.appender.A_INTERFACES_ADSI.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - %m%n
log4j.appender.A_INTERFACES_ADSI.append=true
log4j.logger.log_Interfaces_ADSI=DEBUG,A_INTERFACES_ADSI

We don't know what's happening here, do you have any suggestion?

So many thanks to all of you.

Upvotes: 0

Views: 408

Answers (1)

user3671433
user3671433

Reputation:

It may be late but I had similar problem in log4j XML config file and now I tried to put the file path inside "quotes" and it seems it compress now.

Upvotes: 1

Related Questions