LoggerMaxSize Property
Gets or sets the maximum allowed length (in characters) of the file or memory log.

Namespace: MailBee
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public int MaxSize { get; set; }

Property Value

Type: Int32
If value is a positive integer, it specifies the maximum length (in characters) of the log; if 0 or negative, the log size is unlimited. The default value is 0.

This property can be set to prevent unlimited growth of the log file. When MaxSize is set to certain positive integer value, the log size will never exceed this value (unless it's not too small so that even one log entry would not fit).

If the memory log is used and the log size is going to exceed MaxSize value, the oldest half of the log is removed (the removal occurs on the entry boundaries so that individual entries are not splitted).

If the file log is used and the log size is going to exceed MaxSize value, the log file is renamed into OldFilename name and then cleared (or just cleared if OldFilename property is not set).

The developer may also call Clear method to clear the log.

Note Note
The log size limitation is a character count, not byte count. When using logging into a file, some characters can be converted into multi-byte sequences (especially, if UTF8 encoding is used), so that the log file size in bytes may get larger than MaxSize value.
See Also