Table of Contents

Class FileLogListener

Namespace
StockSharp.Logging
Assembly
StockSharp.Logging.dll

The logger recording the data to a text file.

public class FileLogListener : LogListener, ILogListener, IPersistable, IDisposable
Inheritance
FileLogListener
Implements
IPersistable
Inherited Members
Extension Methods

Constructors

FileLogListener()

To create FileLogListener. For each ILogSource a separate file with a name equal to Name will be created.

public FileLogListener()

FileLogListener(string)

To create FileLogListener. All messages from the Log will be recorded to the file fileName.

public FileLogListener(string fileName)

Parameters

fileName string

The name of a text file to which messages from the event Log will be recorded.

Properties

Append

Whether to add the data to a file, if it already exists. The default is off.

public bool Append { get; set; }

Property Value

bool

DirectoryDateFormat

The directory name format that represents a date. By default is 'yyyy_MM_dd'.

public string DirectoryDateFormat { get; set; }

Property Value

string

Encoding

File encoding. The default is UTF-8 encoding.

public Encoding Encoding { get; set; }

Property Value

Encoding

Extension

Extension of log files. The default value is 'txt'.

public string Extension { get; set; }

Property Value

string

FileName

The name of a text file (without filename extension) to which messages from the event Log will be recorded.

public string FileName { get; set; }

Property Value

string

HistoryAfter

Offset from present day indicates are logs are out of date.

public TimeSpan HistoryAfter { get; set; }

Property Value

TimeSpan

HistoryCompressionLevel

Uses in case of Compression. Default is Optimal.

public CompressionLevel HistoryCompressionLevel { get; set; }

Property Value

CompressionLevel

HistoryMove

Uses in case of Move. Default is null.

public string HistoryMove { get; set; }

Property Value

string

HistoryPolicy

FileLogHistoryPolicies. By default is None.

public FileLogHistoryPolicies HistoryPolicy { get; set; }

Property Value

FileLogHistoryPolicies

LogDirectory

The directory where the log file will be created. By default, it is the directory where the executable file is located.

public string LogDirectory { get; set; }

Property Value

string

Remarks

If the directory does not exist, it will be created.

MaxCount

The maximum number of rolling files. The default is 0, which means that the files will be rolled without limitation.

public int MaxCount { get; set; }

Property Value

int

MaxLength

The maximum length of the log file. The default is 0, which means that the file will have unlimited size.

public long MaxLength { get; set; }

Property Value

long

SeparateByDates

The mode of log files splitting by date. The default mode is None.

public SeparateByDateModes SeparateByDates { get; set; }

Property Value

SeparateByDateModes

WriteChildDataToRootFile

To record the subsidiary sources data to the parent file. The default mode is enabled.

public bool WriteChildDataToRootFile { get; set; }

Property Value

bool

WriteSourceId

To output the source identifier Id to a file. The default is off.

public bool WriteSourceId { get; set; }

Property Value

bool

Methods

DisposeManaged()

Release resources.

protected override void DisposeManaged()

Load(SettingsStorage)

Load settings.

public override void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

OnWriteMessages(IEnumerable<LogMessage>)

To record messages.

protected override void OnWriteMessages(IEnumerable<LogMessage> messages)

Parameters

messages IEnumerable<LogMessage>

Debug messages.

Save(SettingsStorage)

Save settings.

public override void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.