invalid file name is generated by RollingFlatFileTraceListener

Topics: Logging Application Block
Apr 15, 2009 at 10:28 AM
Edited Apr 15, 2009 at 10:30 AM
At a project log is generated with RollingFlatFileTraceListener. It should split up the log into serveral log files based on size of the file. It works fine for all files except the first file. I mean log files are named as Log.Log , Log200901120653.log , Log200901130653.log ....

Is it a bug,issue or constraint at RollingFlatFileTraceListener or should I change my code? I want to attach the TimeStamp to all files.
I will brig the code here:

string TimeStampPattern = "yyyyMMddhhmmss";
RollingFlatFileTraceListener rollingFlatFileTraceListener = new RollingFlatFileTraceListener(FileName, Header, Footer, Formatter, RollSizeKB, TimeStampPattern, RollFileExistsBehavior, RollInterval) { Name = "Rolling Flat File Trace Listener" };

LogSource mainLogSource = new LogSource("Logging Application Block", SourceLevels.All);

Thanks for help in advance

Apr 15, 2009 at 11:35 AM
Edited Apr 15, 2009 at 11:36 AM

AFAIK, it's just the expected behavior because it is the filename(Log.log) that you've set to the tracelistener and it will only start incrementing the file name on the first rollover of the file.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.