Daily Rolling Flat File - use date of log entries

Topics: Logging Application Block
Oct 4, 2010 at 3:08 PM

We are using a rolling flat file that rolls every day at midnight - we need the date on the file to be the date of the log entries (not the day the log file was rolled) - in ent lib 4.1 we created a custom Trace Listener, but the classes we based this on are no longer present in ent lib 5.0

So, before we go off and create a new listener - is there a way we can configure the rolling flat file listener to use yesterday's date - or can we override a method of the existing rolling flat file listener?

Oct 4, 2010 at 3:43 PM
Edited Oct 7, 2010 at 1:16 AM

That is not configurable in a rolling flat file listener nor there is a virtual method which you can override.  There is'nt much change in the said trace listener in EntLib 5.  There was just an addition of the Max Archived Files property.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Oct 4, 2010 at 3:47 PM

Our original implementation used the TraceListenerAsssembler class (which is now gone).

In looking through the source code, it looks like I can just change the value in the CalculateNextRollDate method.  Unfortunately, this method is in the sealed StreamWriterRollingHelper class, so I can’t just override the method.

From: AvanadeSupport [mailto:notifications@codeplex.com]
Sent: Monday, October 04, 2010 9:44 AM
To: Steve Billingsley
Subject: Re: Daily Rolling Flat File - use date of log entries [entlib:229543]

From: AvanadeSupport

That is not configurable in a rolling flat file listener nor there is a virtual method which you can override. There is'nt much change in the said trace listener in EntLib 5. There was just an addition of the RollSizeinKB property.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com



NOTICE: This e-mail message and its attachments are for the sole use of the intended recipient(s) and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return the message to the sender and delete the message and any attachments from your computer. The unauthorized use, dissemination, distribution or reproduction of this e-mail, including attachments, is prohibited and may be unlawful.


Oct 4, 2010 at 4:15 PM

The assembler classes were removed in EntLib 5.  Creating custom providers is made simpler in the version 5.0.  This is well documented, here's the link to this specific topic. 

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Oct 5, 2010 at 8:40 PM

I used the concepts from this post by Chris Tavares

http://stackoverflow.com/questions/3438362/unity-entlib-injecting-a-dependency-into-a-customtracelistener

I was able to use the source code for the rolling flat file trace listener, and adjust the data class so that the GetCreationExpression() function generated the correct class for me.  I did not have to build a listener from scratch, and was able to inherit directly from the existing RollingFlatFileTraceListener.

From: AvanadeSupport [mailto:notifications@codeplex.com]
Sent: Monday, October 04, 2010 10:15 AM
To: Steve Billingsley
Subject: Re: Daily Rolling Flat File - use date of log entries [entlib:229543]

From: AvanadeSupport

The assembler classes were removed in EntLib 5. Creating custom providers is made simpler in the version 5.0. This is well documented, here's the link to this specific topic.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com



NOTICE: This e-mail message and its attachments are for the sole use of the intended recipient(s) and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return the message to the sender and delete the message and any attachments from your computer. The unauthorized use, dissemination, distribution or reproduction of this e-mail, including attachments, is prohibited and may be unlawful.