Cette documentation est archivée et n’est pas conservée.

LogPolicy, classe

Represents the policy associated with a LogStore.

Espace de noms: System.IO.Log
Assembly : System.IO.Log (dans system.io.log.dll)

public sealed class LogPolicy
public final class LogPolicy
public final class LogPolicy
Non applicable.

A policy is a set of rules to be followed by a LogStore instance and its clients. A LogPolicy instance is used to examine and modify the policy associated with a specific LogStore. A policy can describe the minimum and maximum allowable log sizes, or how the LogStore instance is allowed to grow. In addition, you can also control whether a LogStore instance can be archived.

After changing any of the properties, you should use the Commit method to ensure that the changes are applied to the LogStore. You can call the Refresh method to discard changes or to get the most current policy.

The following example shows how to use this class.

public class PolicySetter
    public static void SetSomePolicy(LogPolicy policy)
        // Set the rate of growth to two extents.
        policy.GrowthRate = PolicyUnit.Extents(2);
        // Set the pinned tail threshold to 10%.
        policy.PinnedTailThreshold = new PolicyUnit(
            10, PolicyUnitType.Percentage);


Les membres statiques publics (Shared en Visual Basic) de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile pour Pocket PC, Windows Mobile pour Smartphone, Windows Server 2003, Windows XP Édition Media Center, Windows XP Professionnel Édition x64, Windows XP SP2, Windows XP Starter Edition

Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.

.NET Framework

Prise en charge dans : 3.0