FileLogTraceListener.MaxFileSize Property

Note: This property is new in the .NET Framework version 2.0.

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 long MaxFileSize { get; set; }
/** @property */
public long get_MaxFileSize ()

/** @property */
public void set_MaxFileSize (long value)

public function get MaxFileSize () : long

public function set MaxFileSize (value : long)

Property Value

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

Exception typeCondition


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.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions