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
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
DirectoryDateFormat
The directory name format that represents a date. By default is 'yyyy_MM_dd'.
public string DirectoryDateFormat { get; set; }
Property Value
Encoding
File encoding. The default is UTF-8 encoding.
public Encoding Encoding { get; set; }
Property Value
Extension
Extension of log files. The default value is 'txt'.
public string Extension { get; set; }
Property Value
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
HistoryAfter
Offset from present day indicates are logs are out of date.
public TimeSpan HistoryAfter { get; set; }
Property Value
HistoryCompressionLevel
Uses in case of Compression. Default is Optimal.
public CompressionLevel HistoryCompressionLevel { get; set; }
Property Value
HistoryMove
public string HistoryMove { get; set; }
Property Value
HistoryPolicy
FileLogHistoryPolicies. By default is None.
public FileLogHistoryPolicies HistoryPolicy { get; set; }
Property Value
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
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
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
SeparateByDates
The mode of log files splitting by date. The default mode is None.
public SeparateByDateModes SeparateByDates { get; set; }
Property Value
WriteChildDataToRootFile
To record the subsidiary sources data to the parent file. The default mode is enabled.
public bool WriteChildDataToRootFile { get; set; }
Property Value
WriteSourceId
To output the source identifier Id to a file. The default is off.
public bool WriteSourceId { get; set; }
Property Value
Methods
DisposeManaged()
Release resources.
protected override void DisposeManaged()
Load(SettingsStorage)
Load settings.
public override void Load(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings 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
SettingsStorageSettings storage.