C# 클래스 CK.Monitoring.MonitorFileOutputBase

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.).
상속: IDisposable
파일 보기 프로젝트 열기: Invenietis/ck-core

공개 메소드들

메소드 설명
Close ( ) : void

Closes the file if it is currently opened. Does nothing otherwise.

Dispose ( ) : void

Simply calls Close.

Initialize ( IActivityMonitor monitor ) : bool

Checks whether this MonitorFileOutputBase is valid: its base path is successfully created. Can be called multiple times.

보호된 메소드들

메소드 설명
AfterWrite ( ) : void

This method must be called after write: it closes and produces the final file if the current file is full.

BeforeWrite ( ) : void

This method must be called before any write: it calls OpenNewFile if needed.

CloseCurrentFile ( ) : void

Closes the currently opended file.

MonitorFileOutputBase ( string configuredPath, System.Guid monitorId, int maxCountPerFile, bool useGzipCompression ) : System

Initializes a new file for ILogEntry issued from a specific monitor: the final file name is based on FileUtil.FileNameUniqueTimeUtcFormat with a "-{XXX...XXX}.ckmon" suffix where {XXX...XXX} is the unique identifier (Guid with the B format - 32 digits separated by hyphens, enclosed in braces) of the monitor. You must call Initialize before actually using this object.

MonitorFileOutputBase ( string configuredPath, string fileNameSuffix, 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.

OpenNewFile ( ) : Stream

Opens a new file suffixed by ".tmp".

비공개 메소드들

메소드 설명
ComputeBasePath ( IActivityMonitor m ) : string

Computes the root path.

메소드 상세

AfterWrite() 보호된 메소드

This method must be called after write: it closes and produces the final file if the current file is full.
protected AfterWrite ( ) : void
리턴 void

BeforeWrite() 보호된 메소드

This method must be called before any write: it calls OpenNewFile if needed.
protected BeforeWrite ( ) : void
리턴 void

Close() 공개 메소드

Closes the file if it is currently opened. Does nothing otherwise.
public Close ( ) : void
리턴 void

CloseCurrentFile() 보호된 메소드

Closes the currently opended file.
protected CloseCurrentFile ( ) : void
리턴 void

Dispose() 공개 메소드

Simply calls Close.
public Dispose ( ) : void
리턴 void

Initialize() 공개 메소드

Checks whether this MonitorFileOutputBase is valid: its base path is successfully created. Can be called multiple times.
public Initialize ( IActivityMonitor monitor ) : bool
monitor IActivityMonitor Required monitor.
리턴 bool

MonitorFileOutputBase() 보호된 메소드

Initializes a new file for ILogEntry issued from a specific monitor: the final file name is based on FileUtil.FileNameUniqueTimeUtcFormat with a "-{XXX...XXX}.ckmon" suffix where {XXX...XXX} is the unique identifier (Guid with the B format - 32 digits separated by hyphens, enclosed in braces) of the monitor. You must call Initialize before actually using this object.
protected MonitorFileOutputBase ( string configuredPath, System.Guid monitorId, int maxCountPerFile, bool useGzipCompression ) : System
configuredPath string The path. Can be absolute. When relative, it will be under that must be set.
monitorId System.Guid Monitor identifier.
maxCountPerFile int Maximum number of entries per file. Must be greater than 1.
useGzipCompression bool True to gzip the file.
리턴 System

MonitorFileOutputBase() 보호된 메소드

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.
protected MonitorFileOutputBase ( string configuredPath, string fileNameSuffix, int maxCountPerFile, bool useGzipCompression ) : System
configuredPath string The path: it can be absolute and when relative, it will be under (that must be set).
fileNameSuffix string Suffix of the file including its extension. Must not be null nor empty.
maxCountPerFile int Maximum number of entries per file. Must be greater than 1.
useGzipCompression bool True to gzip the file.
리턴 System

OpenNewFile() 보호된 메소드

Opens a new file suffixed by ".tmp".
protected OpenNewFile ( ) : Stream
리턴 Stream