C# Class NLog.Targets.FileTarget.DynamicFileArchive

Show file Open project: NLog/NLog

Public Methods

Method Description
DynamicFileArchive ( FileTarget fileTarget, int maxArchivedFiles ) : Common.System

Creates an instance of DynamicFileArchive class.

InitializeForArchiveFolderPath ( string archiveFolderPath ) : void

Adds the files in the specified path to the archive file queue.

Private Methods

Method Description
AddToArchive ( string archiveFileName, string fileName, bool createDirectory ) : void

Archives the file, either by copying it to a new file system location or by compressing it, and add the file name into the list of archives.

Archive ( string archiveFileName, string fileName, bool createDirectory ) : bool
DeleteOldArchiveFiles ( ) : void

Remove old archive files when the files on the queue are more than the P:MaxArchiveFilesToKeep.

ExtractArchiveNumberFromFileName ( string archiveFileName ) : int
GetNextArchiveFileName ( string fileName ) : string

Gets the file name for the next archive file by appending a number to the provided "base"-filename. Example: Original Filename trace.log Target Filename trace.15.log

Method Details

DynamicFileArchive() public method

Creates an instance of DynamicFileArchive class.
public DynamicFileArchive ( FileTarget fileTarget, int maxArchivedFiles ) : Common.System
fileTarget FileTarget The file target instance whose files to archive.
maxArchivedFiles int Maximum number of archive files to be kept.
return Common.System

InitializeForArchiveFolderPath() public method

Adds the files in the specified path to the archive file queue.
public InitializeForArchiveFolderPath ( string archiveFolderPath ) : void
archiveFolderPath string The folder where the archive files are stored.
return void