C# Class CK.Monitoring.MonitorTextFileOutput

Helper class that encapsulates temporary stream and final renaming for log entries streams. This currently handles only the maximum count of entries per file but this may be extended with options like "SubFolderMode" that can be based on current time (to group logs inside timed intermediate folders like one per day: 2014/01/12 or 2014-01/12, etc.).
Inheritance: MonitorFileOutputBase
Afficher le fichier Open project: Invenietis/ck-core

Méthodes publiques

Méthode Description
MonitorTextFileOutput ( string configuredPath, int maxCountPerFile, bool useGzipCompression ) : System

Initializes a new file for IMulticastLogEntry: the final file name is based on FileUtil.FileNameUniqueTimeUtcFormat with a ".ckmon" extension. You must call Initialize before actually using this object.

Write ( IMulticastLogEntry e ) : void

Writes a log entry (that can actually be a IMulticastLogEntry).

Méthodes protégées

Méthode Description
CloseCurrentFile ( ) : void

Called when the current file is closed.

OpenNewFile ( ) : Stream

Called when a new file is created.

Method Details

CloseCurrentFile() protected méthode

Called when the current file is closed.
protected CloseCurrentFile ( ) : void
Résultat void

MonitorTextFileOutput() public méthode

Initializes a new file for IMulticastLogEntry: the final file name is based on FileUtil.FileNameUniqueTimeUtcFormat with a ".ckmon" extension. You must call Initialize before actually using this object.
public MonitorTextFileOutput ( string configuredPath, int maxCountPerFile, bool useGzipCompression ) : System
configuredPath string The path: it can be absolute and when relative, it will be under (that must be set).
maxCountPerFile int Maximum number of entries per file. Must be greater than 1.
useGzipCompression bool True to gzip the file.
Résultat System

OpenNewFile() protected méthode

Called when a new file is created.
protected OpenNewFile ( ) : Stream
Résultat Stream

Write() public méthode

Writes a log entry (that can actually be a IMulticastLogEntry).
public Write ( IMulticastLogEntry e ) : void
e IMulticastLogEntry The log entry.
Résultat void