C# Класс WebApplications.Utilities.Logging.Loggers.FileLogger

Наследование: LoggerBase
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
FileLogger System
ValidatePathFormat FormatBuilder

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

Метод Описание
Add ( IEnumerable logs, CancellationToken token = default(CancellationToken) ) : Task

Adds the specified logs to storage in batches.

CloseFile ( ) : void

Closes the current log file.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FileLogger ( [ name, [ directory = null, System.Int64 maxLog = 1000, System.TimeSpan maxDuration = default(TimeSpan), LoggingLevels validLevels = LoggingLevels.All, [ format = null, [ fileNameFormat = null, [ extension = null, uint buffer = 65536, bool autoFlush = false ) : System

Initializes a new instance of the FileLogger class.

Flush ( CancellationToken token = default(CancellationToken) ) : Task

Force a flush of this logger.

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

Метод Описание
FileLogger ( ) : System

Initializes static members of the FileLogger class.

ValidatePathFormat ( [ directory, [ fileNameFormat, [ extension, [ format ) : FormatBuilder

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

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

Adds the specified logs to storage in batches.
public Add ( IEnumerable logs, CancellationToken token = default(CancellationToken) ) : Task
logs IEnumerable The logs to add to storage.
token System.Threading.CancellationToken The token.
Результат Task

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

Closes the current log file.
public CloseFile ( ) : void
Результат void

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

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

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

Initializes a new instance of the FileLogger class.
/// was less than 10, which would result in too many log files to be created. /// -or- /// /// was less than 10 seconds, which would result in too many log files to be created. /// -or- /// /// was either null or whitespace. /// -or- /// The string was either null or whitespace. /// -or- /// An error occurred trying to access the . /// -or- /// /// was more than 5 characters long. /// -or- /// The led to an invalid path or created a path that references the wrong . /// -or- /// File path contained invalid characters.
public FileLogger ( [ name, [ directory = null, System.Int64 maxLog = 1000, System.TimeSpan maxDuration = default(TimeSpan), LoggingLevels validLevels = LoggingLevels.All, [ format = null, [ fileNameFormat = null, [ extension = null, uint buffer = 65536, bool autoFlush = false ) : System
name [ The filename.
directory [ The directory to log to (default to entry assembly directory).
maxLog System.Int64 The maximum number of log items in a single log file. /// By default this is set to 1,000.
maxDuration System.TimeSpan The maximum time period that a single log file can cover.
validLevels LoggingLevels The valid log levels. /// By default allows all log levels.
format [ The log format (default to "Verbose,Xml").
fileNameFormat [ The filename format - where {DateTime} is the creation date time. /// By default the format is "{ApplicationName}-{DateTime:yyMMddHHmmssffff}".
extension [ The file extension. /// By default this is set to use "log".
buffer uint The buffer.
autoFlush bool if set to [auto flush].
Результат System

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

Force a flush of this logger.
public Flush ( CancellationToken token = default(CancellationToken) ) : Task
token System.Threading.CancellationToken
Результат Task