FileLogTraceListener.MaxFileSize Property

Definition

Gets or sets the maximum allowed size of the log file, in bytes.

public:
 property long MaxFileSize { long get(); void set(long value); };
public long MaxFileSize { get; set; }
member this.MaxFileSize : int64 with get, set
Public Property MaxFileSize As Long

Property Value

Long. This is the maximum allowed log-file size, in bytes. The default value is 5000000.

Exceptions

When this property is set to a value less than 1000.

Remarks

Use this property to make sure that the log files do not grow too large.

If the log file size (in bytes) is greater than the value of this property, then when the FileLogTraceListener class attempts to write a message to the log, the message is discarded and the failure is either silent or an exception is thrown depending on the value of the DiskSpaceExhaustedBehavior property. Otherwise, the message is written to the log, if the amount of free disk space (in bytes) is less than ReserveDiskSpace.

Applies to

See also