FileLogTraceListener.ReserveDiskSpace Property

Definition

Gets or sets the amount of free disk space, in bytes, necessary before messages can be written to the log file.

C#
public long ReserveDiskSpace { get; set; }

Property Value

Long. This is the amount of free disk space necessary. The default value is 10000000.

Exceptions

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

Remarks

Use this property to make sure that the log files do not completely fill the disk.

If the amount of free disk space (in bytes) is less 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 log file size (in bytes) is greater than MaxFileSize.

Applies to

Производ Верзије
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 5, 6, 7, 8, 9, 10

See also