C# 클래스 WebApplications.Utilities.Logging.Loggers.FileLogger

상속: LoggerBase
파일 보기 프로젝트 열기: webappsuk/CoreLibraries

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