Enterprise Library 5.0, Application Logging Block, Add a timestamp to the filename

Topics: Logging Application Block
Feb 20, 2013 at 3:07 PM

I am attempting to use the Enterprise Library 5.0 Application Logging Block to write a log file for a nightly batch process. I would like the filename to include a timestamp, such as LogFile2013-02-15-131151.log

I'm aware that I can use a rolling flat file listener to add the date to archived files (If you chose the rolling flat file trace listener, the block will add the current date and an incrementing number to the filename of archived log files), however, I am not interested in adding the current timestamp to an archived file. I want the timestamp to reflect the datetime the file was created, not the datetime it was archived.

Is this possible?

Thanks kindly,
Feb 21, 2013 at 3:31 AM
This discussion talks about a very similar scenario (directory name instead of filename but the principle is the same).

Randy Levy
Enterprise Library support engineer
Support How-to