Unosquare
    Show / Hide Table of Contents

    Class FileLogger

    A helper class to write into files the messages sent by the Terminal.

    Inheritance
    Object
    TextLogger
    FileLogger
    Implements
    ILogger
    IDisposable
    Inherited Members
    TextLogger.LoggingTimeFormat
    TextLogger.GetOutputAndColor(LogMessageReceivedEventArgs)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Swan.Logging
    Syntax
    public class FileLogger : TextLogger, ILogger, IDisposable

    Constructors

    FileLogger()

    Initializes a new instance of the FileLogger class.

    Declaration
    public FileLogger()

    FileLogger(String, Boolean)

    Initializes a new instance of the FileLogger class.

    Declaration
    public FileLogger(string filePath, bool dailyFile)
    Parameters
    Type Name Description
    String filePath

    The filePath.

    Boolean dailyFile

    if set to true [daily file].

    Properties

    DailyFile

    Gets a value indicating whether [daily file].

    Declaration
    public bool DailyFile { get; }
    Property Value
    Type Description
    Boolean

    true if [daily file]; otherwise, false.

    FilePath

    Gets the file path.

    Declaration
    public string FilePath { get; }
    Property Value
    Type Description
    String

    The file path.

    LogLevel

    Gets the log level.

    Declaration
    public LogLevel LogLevel { get; set; }
    Property Value
    Type Description
    LogLevel

    The log level.

    Methods

    Dispose()

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    Log(LogMessageReceivedEventArgs)

    Logs the specified log event.

    Declaration
    public void Log(LogMessageReceivedEventArgs logEvent)
    Parameters
    Type Name Description
    LogMessageReceivedEventArgs logEvent

    The LogMessageReceivedEventArgs instance containing the event data.

    Implements

    ILogger
    System.IDisposable

    See Also

    ILogger

    Comments

    Back to top Copyright © 2017-2019 Unosquare