Enterprise Libraray Logging Application Block - Roll File Exists behavior

Topics: Enterprise Library Core, Logging Application Block
Jul 24, 2014 at 6:49 AM
Hi all,
Am using EntLib for logging purpose, as of now it creates a new log file in the same directory whenever the log file size exceeds the specified limit . I want it to be stored in a different directory say "Archivefolder". Is there any way to do it?
Jul 24, 2014 at 2:17 PM
The directory for the archive log file is set to the directory of the current file. There is no setting to change that out-of-box. You could implement a custom rolling flat file trace listener that performs the archive in the way that you want. There is already a custom Rolling Flat File on the Enterprise Library V6 Sample Projects page which should get you most of the way there.

Another alternative is to create a process/service/scheduled task that cleans up the logging directory and archives the files on a regular basis.


~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to