سؤال

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.

هل كانت مفيدة؟

المحلول 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.

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top