FileLogTraceListener::MaxFileSize Property

 

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

Namespace:   Microsoft.VisualBasic.Logging
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public:
property long long MaxFileSize {
	long long get();
	void set(long long value);
}

Property Value

Type: System::Int64

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

Exception Condition
ArgumentException

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

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.

.NET Framework
Available since 2.0
Return to top
Show: