C# Class NLog.Internal.FileAppenders.FileAppenderCache

Maintains a collection of file appenders usually associated with file targets.
Afficher le fichier Open project: NLog/NLog Class Usage Examples

Méthodes publiques

Свойство Type Description
Empty FileAppenderCache

Méthodes publiques

Méthode Description
AllocateAppender ( string fileName ) : BaseFileAppender

It allocates the first slot in the list when the file name does not already in the list and clean up any unused slots.

CloseAppenders ( ) : void

Close all the allocated appenders.

CloseAppenders ( System.DateTime expireTime ) : void

Close the allocated appenders initialised before the supplied time.

Dispose ( ) : void
FileAppenderCache ( int size, IFileAppenderFactory appenderFactory, ICreateFileParameters createFileParams ) : System

Initializes a new instance of the FileAppenderCache class.

The size of the list should be positive. No validations are performed during initialisation as it is an intenal class.

FlushAppenders ( ) : void

Fluch all the allocated appenders.

GetArchiveMutex ( string fileName ) : Mutex
GetFileCreationTimeUtc ( string filePath, bool fallback ) : DateTime?
GetFileLastWriteTimeUtc ( string filePath, bool fallback ) : DateTime?
GetFileLength ( string filePath, bool fallback ) : long?
InvalidateAppender ( string filePath ) : void

Closes the specified appender and removes it from the list.

InvalidateAppendersForInvalidFiles ( ) : void

Invalidates appenders for all files that were archived.

Private Methods

Méthode Description
CloseAppender ( BaseFileAppender appender ) : void
ExternalFileArchivingWatcher_OnFileChanged ( object sender, FileSystemEventArgs e ) : void
FileAppenderCache ( ) : System

Initializes a new "empty" instance of the FileAppenderCache class with zero size and empty list of appenders.

GetAppender ( string fileName ) : BaseFileAppender

Method Details

AllocateAppender() public méthode

It allocates the first slot in the list when the file name does not already in the list and clean up any unused slots.
/// Thrown when is called on an Empty instance. ///
public AllocateAppender ( string fileName ) : BaseFileAppender
fileName string File name associated with a single appender.
Résultat BaseFileAppender

CloseAppenders() public méthode

Close all the allocated appenders.
public CloseAppenders ( ) : void
Résultat void

CloseAppenders() public méthode

Close the allocated appenders initialised before the supplied time.
public CloseAppenders ( System.DateTime expireTime ) : void
expireTime System.DateTime The time which prior the appenders considered expired
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

FileAppenderCache() public méthode

Initializes a new instance of the FileAppenderCache class.
The size of the list should be positive. No validations are performed during initialisation as it is an intenal class.
public FileAppenderCache ( int size, IFileAppenderFactory appenderFactory, ICreateFileParameters createFileParams ) : System
size int Total number of appenders allowed in list.
appenderFactory IFileAppenderFactory Factory used to create each appender.
createFileParams ICreateFileParameters Parameters used for creating a file.
Résultat System

FlushAppenders() public méthode

Fluch all the allocated appenders.
public FlushAppenders ( ) : void
Résultat void

GetArchiveMutex() public méthode

public GetArchiveMutex ( string fileName ) : Mutex
fileName string
Résultat Mutex

GetFileCreationTimeUtc() public méthode

public GetFileCreationTimeUtc ( string filePath, bool fallback ) : DateTime?
filePath string
fallback bool
Résultat DateTime?

GetFileLastWriteTimeUtc() public méthode

public GetFileLastWriteTimeUtc ( string filePath, bool fallback ) : DateTime?
filePath string
fallback bool
Résultat DateTime?

GetFileLength() public méthode

public GetFileLength ( string filePath, bool fallback ) : long?
filePath string
fallback bool
Résultat long?

InvalidateAppender() public méthode

Closes the specified appender and removes it from the list.
public InvalidateAppender ( string filePath ) : void
filePath string File name of the appender to be closed.
Résultat void

InvalidateAppendersForInvalidFiles() public méthode

Invalidates appenders for all files that were archived.
public InvalidateAppendersForInvalidFiles ( ) : void
Résultat void

Property Details

Empty public_oe static_oe property

An "empty" instance of the FileAppenderCache class with zero size and empty list of appenders.
public static FileAppenderCache,NLog.Internal.FileAppenders Empty
Résultat FileAppenderCache