Wed, Feb 15 2006 7:22 PM Erwyn van der Meer

Rolling File Trace Listener Extension for Enterprise Library 2.0

Rolling File Trace Listener

Erwyn van der Meer, LogicaCMG
Based on Rolling File Sink by Hisham Baz, Avanade

Download v0.5.2.0 source code + documentation. The source code and documentation are provided "AS-IS". Feel free to change and/or extend them. Please contact me or leave a comment if you find an issue.

Last updated: April 18, 2006

Overview

This article describes the RollingFileTraceListener extension of the Logging block of version 2.0 of the Microsoft Enterprise Library.  This is a custom trace listener that can be plugged into the Enterprise Library Logging block like the standard trace listeners that are included. The FlatFileTraceListener shipped with EntLib 2.0 may not be adequate for enterprise systems since log files by default will continue to grow unchecked.  This new trace listener provides support for rolling over log files based on age of the log file or file size.

Usage

The ZIP file contains a Visual Studio 2005 solution and projects with C# sources that are fully documented with XML comments. Extract the ZIP file, open the EnterpriseLibraryExtensions.sln solution in Visual Studio 2005 and build the solution. This will create the assemblies for the RollingFileTraceListener and a test application.

In Windows the maximum path + filename length for a file is 260 characters. Please ensure you extract the ZIP file into a directory with a path that is less than 82 characters in length. Otherwise you will get a compilation error because during compilation Visual Studio will create an intermediate file with a really long name for which the path exceeds the limit of 260 characters.

In order to use the new trace listener from the Enterprise Library Configuration tool, you must copy the assemblies into the same directory as the configuration tool. There are two files that need to be copied - LogicaCMG.EnterpriseLibraryExtensions.Logging.dll and LogicaCMG.EnterpriseLibraryExtensions.Logging.Configuration.Design.dll.  When these files are in the same directory, they will be registered during the startup of the tool. This will allow you to add a new Rolling File Trace Listener from the right-click context menu on the Trace Listeners collection node.

Screenshot of how you can add a RollingFileTraceListener to an application configuration file using the Enterprise Library Configuration Console.

Configuration

The trace listener creates a new log file when the current file exceeds defined thresholds.  The RollingFileTraceListener provides file age and file size thresholds that can be configured using the Enterprise Library Configuration tool like any other trace listener.

Screenshot of the configuration properties that can be set for a RollingFileTraceListener.

 The RollingFileTraceListener has the following properties

  • Filename – filename with optional relative or full path
  • Header – string (optional)
  • Footer – string (optional)
  • MaximumLogFilesBeforePurge – integer
  • Timestamp Format – string, e.g., yyyy-MM-dd [HH:mm:ss]  (optional)
  • Age Threshold - integer
  • Age Unit – None, Minutes, Hours, Days, Weeks, Months
  • Size Threshold – integer
  • Size Unit – None, KB, MB, GB

Design

The RollingFileTraceListener uses a database-style log roll-over process.  All new log entries are written to the file defined in the FileName property.  Before a log entry is written, the trace listener checks to see if the file has grown too big or the age limit has expired.  If the current log file exceeds the size or age threshold, then the log file is renamed with the current timestamp or an incremental counter.  The new file is created with the same name defined in FileName. So the current log file always has the same name.

Age Threshold

The age threshold allows you to limit the growth of your log files according to age.  The threshold is compared by evaluating the current date/time against the log file creation date/time.  For example, if the log file was created on 1/1/2006 at 3PM and the age threshold was set to 2 days, a new log file will be created for the first log entry written after 1/3/2006 at 3PM.

There are two properties that control the age threshold behavior – AgeThreshold and AgeUnit.  Select the appropriate unit size first – None, Minutes, Hours, Days, Weeks or Months - by setting the AgeUnit property.  Set the AgeThreshold property to 0 or the AgeUnit to None to disable the age threshold check.

Size Threshold

In addition to age threshold, you can limit log file growth based on file size

There are two properties that control the age threshold behavior – SizeThreshold and SizeUnit.  Select the appropriate unit size first – None, Kilobytes, Megabytes or Gigabytes - by setting the SizeUnit property.  Set the SizeThreshold property to 0 or the SizeUnit to None to disable the file size threshold check. 

Combination Thresholds

Both the age and size thresholds can be applied at the same time.  For example, logs can be configured to roll-over every week or earlier if the file grows over 10MB. To accomplish this, set the AgeUnit to Weeks, AgeThreshold to 1, SizeUnit to Megabytes and SizeThreshold to 10.

Filename Formatting

When log file exceeds the defined thresholds, it is given a new unique name.

The TimestampFormat property can be used to define a date-time format string used for generating new file names.  This allows overgrown or overaged log files to be renamed and stamped with the current timestamp. The timestamp is appended to the end of the new filename, before the extension.  For example, if TimestampFormat is set to yyyy-MM-dd and FileName is set to app.log, then when rolling over on February 15, 2006 the current log file is renamed to app2006-02-15.log.

If the new filename already exists, then an incremental counter is added until a unique combination is found.  If the TimestampFormat property is left blank, the counter will always be appended to the end of the FileName.  The counter is formatted to 7 digits (e.g., app[0000123].log) and counting begins from 1.

Purging

Log files can be automatically deleted after a certain maximum number of log files are present by setting the MaximumLogFilesBeforePurge property.  Set this property to 0 to disable automatic purging.  Purging occurs before the current log file is renamed. The log files are deleted in reverse order of their last modification time.

Change log

Version 0.5.2.0 – Fixed a bug that occurred when the application configuration file is changed while an application using the RollingFileTraceListener is running. In that case a GUID was prepended to the filename of the log file, because the log file was still locked by another RollingFileTraceListener instance.

Version 0.5.1.0 – Fixed a bug that prevented the formatter name from being saved correctly when using the Enterprise Library Configuration tool.

Version 0.5.0.0 – First public release.

Known problems

A GUID might be prepended to the filename of the log file

A RollingFileTraceListener instance "owns" the log file it is writing to and locks it for exclusive write access when it writes the first log entry. It keeps the file locked until the instance is disposed. If another RollingFileTraceListener  instance is created that points to the same file, before the first instance is disposed, the second instance cannot open this file for writing and will write to a new file with a GUID prepended to its name.

The RollingFileTraceListener indirectly derives from System.Diagnostics.TextWriterTraceListener. This class changes the filename to include a GUID when the file with the specified filename cannot be written to. This is because RollingFileTraceListener indirectly calls the EnsureWriter method on its base class TextWriterTraceListener. .NET Reflector shows this code for System.Diagnostics.TextWriterTraceListener.EnsureWriter() in System.dll (slightly rewritten to improve clarity):

    try
    {
        this.writer = new StreamWriter(fileNameWithPath, true, encoding1, 0x1000);
        break;
    }
    catch (IOException)
    {
        Guid guid1 = Guid.NewGuid();
        fileName = guid1.ToString() + fileName;
        fileNameWithPath = Path.Combine(folderPath, fileName );
    }
Filed under: ,

# Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, February 15, 2006 11:42 AM by Erwyn van der Meer

I decided to create an EntLib 2.0 version of the Rolling File Sink. My extension is called the Rolling File Trace Listener. It allows log files to roll over based on both age and size limits.

# Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, March 08, 2006 4:52 PM by David Hayden - Sarasota Web Design Development - Florida

# Too long

Tuesday, March 28, 2006 1:04 PM by Joel

Anyone experience too long file name with the extension?

Error 1 Cannot write to the output file "obj\Debug\LogicaCMG.EnterpriseLibraryExtensions.Logging.Configuration.Design.Properties.Resources.resources". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. Logging.Configuration.Design

I wanted to rename everything with shorter name.. but that was a mess. Any tip?

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, March 28, 2006 1:35 PM by DMA

Same thing here ????

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, March 29, 2006 7:59 AM by Joel

Well DMA,

Since I couldn't make it work I try the one from gotdotnet : http://workspaces.gotdotnet.com/RollingFlatFileTraceListener and it work out of the box, but It has less feature I think.

Also, next week, Hisham (from avanade) should relase his version 2 of Rolling Flat file sink for the jan 2006 version en EntLib.

-joel

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, March 29, 2006 10:56 AM by DMA

The solution (EnterpriseLibraryExtensions.sln) was buried into a too deep directory structure (C:\somedir\somedir\..... \EnterpriseLibrary2.0_Extensions_0.5.1.0)

I just decresased the depth of the directory structure and the names of the directories and it now compiles fine.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, April 03, 2006 2:07 AM by Carlo Folini

I also decided to cut the dir structure and it works fine.

Erwyn, do you think to solve the problem so we can stick with your version? (getting the updated/bug fix)

What about sharing your code with the community (sourceforge, gotdotnet workspace, whatever) so we can help evolve your listener?

Ciao
Carlo

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, April 03, 2006 8:25 AM by Erwyn van der Meer

Carlo, where you place the contents of the ZIP file is entirely your choice. You just have to ensure that you don't make the directory hierarchy too deep, so the total path length doesn't exceed 260 characters. Renaming the root directory in the ZIP file from EnterpriseLibrary2.0_Extensions_0.5.1.0 into something shorter after extraction will also help.

The ZIP file comes with full source and people are free to evolve the listener as they please. If people submit improvements back to me, I will consider adding them and create a new version. I am not currently planning on using any web based source control system to turn the RollingFileTraceListener into a community project. If enough improvements flow in, I might reconsider this.



# Enterprise Library 2 Logging: Rolling file trace listener

Monday, April 03, 2006 4:16 PM by Anatoly Lubarsky

# Enterprise Library 2 Logging: Rolling file trace listener

Monday, April 03, 2006 4:19 PM by Anatoly Lubarsky

# unexpected trace file created when config file modified

Tuesday, April 18, 2006 7:47 AM by Tao

When running the program, if you modify the config file, new trace file prefixed with GUID will be created.

# Version 0.5.2.0 of the RollingFileTraceListener extension

Friday, April 21, 2006 12:29 PM by Erwyn van der Meer

I forgot to mention this on my blog, but last Tuesday I released a new version 0.5.2.0 of my RollingFileTraceListener...

# Logging to the same file from different processes?

Wednesday, April 26, 2006 8:54 AM by Jack Pan

Erwyn, your rolling file listener is awesome! The only thing is that an enterprise application can have multiple processes(eg, multiple dllhost.exe) trying to write into the same log file. Could you please add an option so that the logger will close log file after each write? Performance wise it's not good but at least it will allow all log entries in one place. Thank you for the excellent work!

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, April 28, 2006 10:48 AM by Erwyn van der Meer

Jack, it will be very difficult to allow multiple processes to write into the same log file. It is possible to close the log file after each write, but after that it is impossible for the RollingFileTraceListener to guarantee it can open the same file again. If another process is writing an entry to the log file at the same time, opening the file will fail. In that case the System.Diagnostics.TextWriterTraceListener (from which the RollingFileTraceListener ultimately derives) will create a new log file. So it is very unlikely that I will be able to add this option.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, April 28, 2006 11:18 AM by Jack Pan

I see. Thanks Erwyn.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, May 24, 2006 11:17 PM by Vagif Abilov

Erwyn,

First of all, let me thank you for your excellent work. This is exactly what we needed, and we're using it in all internal projects.

I have a couple of comments.

1. This is the way Guid-based filenames are generated:

fileName = guid.ToString() + fileName

This makes it impossible to sort the files in case logs from different listeners are placed in the same folder. Wouldn't it be logical to use Guid as suffix, not prefix, i.e. fileName + guid.ToString()?

2. I've configured logs to purge all files after one day, but I see that Guid-based files are still there. I haven't checked the source code, but can it be that it does not purge files in case the filenames are guid-based?

Best regards
Vagif

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Thursday, May 25, 2006 6:40 PM by Erwyn van der Meer

Vagif,

Thanks.

1. The Guid stuff comes from System.Diagnostics.TextWriterTraceListener.EnsureWriter() so it was not written me. I agree it probably makes more sense to put the Guid as a suffix, but unfortunately I cannot change that.

2. The Guid filenames do not match the file pattern that is used for purging the log files. In LogicaCMG.EnterpriseLibraryExtensions.Logging.TraceListeners.FileNameBuilder there is the following line in the constructor:

_fileNamePattern = _fileNameWithoutExtension + "*" + _extension;

If you change it to

_fileNamePattern = "*" + _fileNameWithoutExtension + "*" + _extension;

the Guid-based files will be deleted as well.

Hope this helps,
Erwyn

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, May 26, 2006 3:22 AM by Vagif Abilov

Erwyn,

Thanks for the answer. I didn't realize that GUID stuff was from EntLib source, I thought it was yours.

I will apply the change you recommend to purge GUID-based files. I guess you will do the same for the version 0.5.3.

Since you work for Logica CMG, maybe you know if Logica has (or plans to have) .NET version of UCP/EMI software. We are working with SMS in Norway, and Norwegian mobile operator Telenor use UCP. We've been using COM-based software from Logica CMG but now want to get rid of unmanaged code. So in case you know if .NET version exists (or know the right persons to ask) I will be greatful.

Best regards
Vagif

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, May 29, 2006 3:10 AM by Erwyn van der Meer

Vagif,

I have no connections with the Telecoms division, so I am unaware of a .NET version of UCP/EMI software. You might want to check out http://www.logicacmg.com/Telecoms/350233883 to see contact options.

Regards,
Erwyn

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, May 29, 2006 5:24 AM by Vagif Abilov

Thanks Erwin!

Vagif

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, May 29, 2006 9:13 AM by Dug

Erwyn,

thank you for your excellent work !
So, i would like to know if I can write log errors and warnings into a file and the write the other "Logger.Write" messages into another file ?

Regards,
Dug

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, May 29, 2006 2:40 PM by Erwyn van der Meer

Dug,

Yes you can do that. Add an extra RollingFileTraceListener which writes to another file using Enterprise Library Configuration tool. And add an extra category to the Category Sources using the tool. Couple that category to the second TraceListener. Specify the category in the Logger.Write(Object message, string category) call.

Or you can use the default Category by leaving it out of the Logger.Write(Object message) call. You can set the default category using the configuration tool. Use another category for logging exceptions so these will go to the other file.

Check out the Enterprise Library documentation for more details.

Regards,
Erwyn

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, May 30, 2006 5:10 AM by Kevin

Anyone else having trouble with the zip file? I get 'Errory copying file of folder', 'The system cannot find the file specified. Additionally 197k seems mighty small for the content. Please advise.

Thanks,
Kevin

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, May 31, 2006 2:01 AM by Dug

Erwyn, thank for all.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Thursday, June 15, 2006 4:12 AM by Knut Hamang

Kevin,
the reason for the error message unzipping the zip file, is some long filenames in the package. If you try with some other unzip software (7-zip for instance), you should be able to unzip the file (with some warnings on the files that are to long). The files with long names will not get unzippped, but if you build the solution everything should work again. The long files are only temporary files in the "obj" folder.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, June 27, 2006 4:37 PM by Vekon

Currently using the flat file trace listener if multiple appdomains try to write to a file, by default these are written to different log files. What should we do to make multiple appdomains write to the same log file.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, June 28, 2006 2:37 PM by Erwyn van der Meer

Vekon, writing from multiple appdomains to a single logfile is not a supported scenario. A trace listener instance (flat file or my rolling version) "owns" the log file. Other instances cannot write to the same file.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Thursday, June 29, 2006 3:12 PM by Vekon

Thanks Erwyn for your reply.  
Right now,  in the app.config file if we name the filename to be "trace.log"  the logging from different appdomains happens to different files with the file names as string.concat(GUID+trace.log). Is there a way to control the naming to say string.concat(Appdomain+trace.log)?
The rolling to different files is happening on these files but I want to be able to control the naming.

Thanks much,
Vekon

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, June 30, 2006 1:38 AM by Erwyn van der Meer

Vekon, for the GUID issue check the known problems section in the article.

Currently you cannot add "dynamic" information to the log file name with the trace listener (flat file or my rolling version). You might want to look into changing the FileNameBuilder class in the sources to support this.

You can also try to contact Alois Kraus (http://geekswithblogs.net/akraus1/). He has mentioned in a comment on my blog (http://bloggingabout.net/blogs/erwyn/archive/2006/02/15/11071.aspx#11590) that he has changed my RollingFileTraceListener to include the process ID in the filename.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Saturday, July 22, 2006 5:18 AM by Eran

Hi Erwyn,
Thanks for releasing this excellent listener.
I have another variation of the GUID problem, which, to the best of my understanding, should not exist.
When I use the exception handling block's logging handler, to log exceptions, and then the logging block is using your trace listener to write the log the exceptions are written to a new file with the GUI prepended.
Any idea how to avoid that?

Thanks,
Eran

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Sunday, July 23, 2006 6:14 AM by Erwyn van der Meer

Hi Eran,

The GUID issue occurs when the RollingFileTraceListener cannot open the specified file for writing. There could potentially be a lot of different reasons for this. For example, another process could have a lock on the file. Another reason is that there might be an NTFS rights issue.

You can use the excellent tool called File Monitor (http://www.sysinternals.com/Utilities/Filemon.html) to see what type of error occurs when the TextWriterTraceListener base class tries to open the log file. You can use Process Explorer (http://www.sysinternals.com/Utilities/ProcessExplorer.html) to find any process that might have an open handle to the log file.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, August 25, 2006 2:25 AM by Sven G.

Hello, very nice tool. I've got a suggestion for further improvement: I need a possibility to trace a special Timestamp Format in front of every LogEntry. Especially, I'd like to trace the milliseconds, that's very useful. It would be outstanding if you can implement this feature. Because even normal EntLib doesn't support this feature. Best regards Sven

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, August 25, 2006 5:23 AM by Erwyn van der Meer

Sven, I think Enterprise Library supports this already. You can use {timestamp(format)} in the formatting template that is used to log every LogEntry. For format you should substitute any format string you like that is accepted by the DateTime.ToString method.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, September 12, 2006 3:56 AM by David van Leerdam

Looks nice. I think that a Lines treshold would be a very useful improvement in a lot of cases. Example: I want to have no more than 1000 log lines in my file. Keep up the good work. Kind regards, David van Leerdam

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, September 13, 2006 1:32 PM by Vadim

Hi Ervyn, If at the time when "rollover" occurs in the method PerformRenameRollover() the log file is opened for read by another process, exception Exception Type: System.IO.IOException Message: The process cannot access the file because it is being used by another process. is thrown by File.Move(_currentLogFileInfo.FullName, archiveFileName); It is very possible that someone will have the file opened for reading, whether to monitor the log in real time, or to check the earlier entries at the time of rollover. How would you recommend to handle a situation like this? Thank you, Vadim

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Thursday, September 14, 2006 3:02 PM by chandra

Erwyn, Very nice functionality,Thanks for the Rolling File Listener. I noticed that timestamp is not correct on log entries, seems like its using different time zone or something, its off by 5 hours with my PC. I appreciated any help regarding this.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, September 19, 2006 12:38 PM by Erwyn van der Meer

Vadim, rolling over an active log file that is locked by another process is not possible. You should not open an active log file in an application that keeps the file open.

Notepad doesn't keep the file open so it doesn't prevent the rename. So use an application like that to check earlier entries.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, September 19, 2006 12:44 PM by Erwyn van der Meer

Chandra, the Enterprise Library 2.0 Logging Application Block uses UTC for timestamps. Check out this blog entry: http://blogs.msdn.com/tomholl/archive/2006/01/22/516055.aspx.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Monday, September 25, 2006 10:53 PM by Peter Gfader

Hello, I have created an Extension of your TraceListener, where every user generates his own Tracefile. I have the Domain, User and Launchdate in the filename. Support for multi process and multi user logging.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Thursday, April 26, 2007 8:15 AM by Dexter Legaspi

this is delicious.  in addition to folder path changes, i signed it so it can be used in BizTalk 2006.  

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, May 01, 2007 3:26 PM by yash

I was able to intergrate with my web application. However, it doesn't create a trace file. I kepts all the setting as metioned in your test project. If I change listner to flat file, it creates a trace file for me. I tried all possible combinations. Am I missing anything here? Any help would very helpful! I liked you code and features. I hope i can make it work.

thx

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, May 01, 2007 11:31 PM by Erwyn van der Meer

Hi Yash, I haven't had any reports of such problems before. Send me your configuration file through the e-mailbutton on the top left of my blog and I'll have a look at it.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Wednesday, May 16, 2007 7:27 AM by Hansjörg

This Trace Listener is really great. I hope that there is also a release that works with the new enterprise library (the rolling flat file trace listener from microsoft" can't purge files when we have to much...

Thx

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, June 05, 2007 10:58 AM by A.Jarrah

Hi All,

really this is a great work

however, am trying to sign the DLLs so i can use them in BizTalk but unfortunately i get the following error:

Error 1 'LogicaCMG.EnterpriseLibraryExtensions.Logging.Configuration.Design.TraceListeners.RollingFileTraceListenerNode.TraceListenerData': type must be 'Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.TraceListenerData' to match overridden member 'Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.TraceListeners.TraceListenerNode.TraceListenerData' E:\EnterpriseLibrary2.0_Extensions_0.5.2.0\Logging Extensions\Configuration\Design\Logging.Configuration.Design\TraceListeners\RollingFileTraceListenerNode.cs 98 37 Logging.Configuration.Design

i replaced the Enterprize Library DLLs with Signed DLLs

and changed the refrences for those signed ones

then the Logging Apllication is signed successfully

but Logging.Configuration.Design is not signed i got the above error

any advice please?

Thanks,

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, July 31, 2007 5:43 PM by Tiago

Hi.

I'm having an issue here:

Everytime I run an iisreset, the log stops working. To fix this, I have to move the log files to another location on the disk and then run iisreset again.

Am I doing anything wrong? Doesn't the Trace Listener append new log entries to the already created file, after an iisreset?

Thanks,

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, September 04, 2007 8:57 AM by XYZ

Is NoOfFileBeforePurge option available for RollingFlatFileTraceListener in Enterprise Library 3.1? If not how to restrict the no of files created by giving the increment rollover option?

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Tuesday, September 04, 2007 9:22 AM by Erwyn van der Meer

Sorry, I can't give any support on the RollingFlatFileTraceListener in Enterprise Library 3.1.

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, September 14, 2007 9:24 AM by nicePerson

Thanks a lot... worked perfectly for me..

# re: Rolling File Trace Listener Extension for Enterprise Library 2.0

Friday, October 05, 2007 10:34 PM by Randy

The GUID prepended to the filename of the log file will cause the log files to not overwrite themselves as intended (e.g. when using timeStampPattern="dd"), which can cause the number of log files to grow unchecked.  A solution is to create a new file using an underscore and count instead of a GUID, if the log file is in use by another process.  See the NoGuid version:

www.codeplex.com/.../PatchList.aspx

This solution has been proposed for the Enterprise Library Contrib:

www.codeplex.com/.../View.aspx