RollingFlatFileTraceListener: Compress or Move the archived logs

Topics: Logging Application Block
Sep 16, 2011 at 5:20 PM

Hi,

Currently, I?m busy integrating the RollingFlatFileTraceListener to write some logs in my application. Since these logs tend to grow large quickly, I use the RollingFlatFileTraceListener to chunk the logs. This works quite well so far.

I am looking for a way to handle the archived files though, ideally moving them and/or compressing them on creation.

Is this possible?

 

Regards

Sep 18, 2011 at 6:20 PM
Edited Sep 18, 2011 at 6:25 PM

Hi,

You need to create a custom RollingFlatFileTraceListener to achieve that. You can refer on the Entlib Source code to get you started.

 

Noel Angelo Bolasoc
Avanade Software
Avanade, Inc.
Contact Us

Sep 18, 2011 at 8:46 PM

Thanks for you reply Noel, I already considered to do so but I didn't like the idea to duplicate the complete implementation to solely add something like an event handler. Isn't there a more elegant way? Deriving or extending seems to be impossible for various reasons.

Regards.

Sep 19, 2011 at 2:45 AM

Unfortunately, this is the only option you might have since the behavior you wanted is not supported out of the box. 

 

Noel Angelo Bolasoc
Avanade Software
Avanade, Inc.
Contact Us