Pregunta

I'm developing a software, which using log4net and enterpriselibrary.logging to log the operations. After 2 hours i got about a 100mb large log files(file names contain the current date), but i want to compress them daily using the logger environment. Is it possible or should i implement a log compresser? (the problems are the client-side logs)

Thank you.

¿Fue útil?

Solución 2

What i was looking for is exactly this:

log4j.appender.oozie.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.oozie.RollingPolicy.FileNamePattern=foo.%d{yyyy-MM-dd-HH}.gz

But this method not supported by log4net & enterprise library, so i had to implement my 'log-backup' operation.

Otros consejos

Check out logrotate. This utility is designed to do exactly what you want.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top