LocalFileLogger Class

Definition

Local file logger writes one line per event. File path specified once per creation and can't be changed during lifetime. It is possible to Enable/Disable logger during the object lifetime. By default logger is created disabled. Once logger enabled log file is either created or opened for appending. Flush on disk happens after every record to be sure that data will persist even in the case of abnormal program termination. Use soft dispose method. No exceptions after dispose, just no-op. That would help for centralized logger, when logger is disposed and some stale component trying to use it. We don't want to fail the whole application in this case.

public ref class LocalFileLogger sealed : IDisposable, Microsoft::VisualStudio::LocalLogger::ILocalFileLogger
public sealed class LocalFileLogger : IDisposable, Microsoft.VisualStudio.LocalLogger.ILocalFileLogger
type LocalFileLogger = class
    interface ILocalFileLogger
    interface IDisposable
Public NotInheritable Class LocalFileLogger
Implements IDisposable, ILocalFileLogger
Inheritance
LocalFileLogger
Implements

Constructors

LocalFileLogger()

Default constructor

LocalFileLogger(String)

Constructor with specified logger file name

Properties

Enabled

Gets or sets a value indicating whether logger enabled or not.

FullLogPath

Gets full logger file path

Methods

Dispose()

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

Log(LocalLoggerSeverity, String, String)

Log current string with severity

Applies to