C# Класс NLog.Internal.FileAppenders.FileAppenderCache

Maintains a collection of file appenders usually associated with file targets.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Empty FileAppenderCache

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

AllocateAppender() публичный Метод

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.
Результат BaseFileAppender

CloseAppenders() публичный Метод

Close all the allocated appenders.
public CloseAppenders ( ) : void
Результат void

CloseAppenders() публичный Метод

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
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

FileAppenderCache() публичный Метод

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.
Результат System

FlushAppenders() публичный Метод

Fluch all the allocated appenders.
public FlushAppenders ( ) : void
Результат void

GetArchiveMutex() публичный Метод

public GetArchiveMutex ( string fileName ) : Mutex
fileName string
Результат Mutex

GetFileCreationTimeUtc() публичный Метод

public GetFileCreationTimeUtc ( string filePath, bool fallback ) : DateTime?
filePath string
fallback bool
Результат DateTime?

GetFileLastWriteTimeUtc() публичный Метод

public GetFileLastWriteTimeUtc ( string filePath, bool fallback ) : DateTime?
filePath string
fallback bool
Результат DateTime?

GetFileLength() публичный Метод

public GetFileLength ( string filePath, bool fallback ) : long?
filePath string
fallback bool
Результат long?

InvalidateAppender() публичный Метод

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.
Результат void

InvalidateAppendersForInvalidFiles() публичный Метод

Invalidates appenders for all files that were archived.
public InvalidateAppendersForInvalidFiles ( ) : void
Результат void

Описание свойств

Empty публичное статическое свойство

An "empty" instance of the FileAppenderCache class with zero size and empty list of appenders.
public static FileAppenderCache,NLog.Internal.FileAppenders Empty
Результат FileAppenderCache