Frage

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.

War es hilfreich?

Lösung 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.

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top