LogPolicy Klas
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Vertegenwoordigt het beleid dat is gekoppeld aan een LogStore.
public ref class LogPolicy sealed
public sealed class LogPolicy
type LogPolicy = class
Public NotInheritable Class LogPolicy
- Overname
-
LogPolicy
Voorbeelden
In dit voorbeeld ziet u hoe u de LogPolicy klasse gebruikt om beleid in te stellen voor een logboekrecordreeks.
// SET LOG POLICY
LogPolicy policy = sequence.LogStore.Policy;
// Set AutoGrow policy. This enables the log to automatically grow
// when the existing extents are full. New extents are added until
// we reach the MaximumExtentCount extents.
// AutoGrow policy is supported only in Windows Vista and not available in R2.
//policy.AutoGrow = true;
// Set the Growth Rate in terms of extents. This policy specifies
// "how much" the log should grow.
policy.GrowthRate = new PolicyUnit(2, PolicyUnitType.Extents);
// Set the AutoShrink policy. This enables the log to automatically
// shrink if the available free space exceeds the shrink percentage.
// AutoGrow/shrink policy is supported only in Windows Vista and not available in R2.
//policy.AutoShrinkPercentage = new PolicyUnit(30, PolicyUnitType.Percentage);
// Set the PinnedTailThreshold policy.
// A tail pinned event is triggered when there is no
// log space available and log space may be freed by advancing the base.
// The user must handle the tail pinned event by advancing the base of the log.
// If the user is not able to move the base of the log, the user should report with exception in
// the tail pinned handler.
// PinnedTailThreashold policy dictates the amount of space that the TailPinned event requests
// for advancing the base of the log. The amount of space can be in percentage or in terms of bytes
// which is rounded off to the nearest containers in CLFS. The default is 35 percent.
policy.PinnedTailThreshold = new PolicyUnit(10, PolicyUnitType.Percentage);
// Set the maximum extents the log can have.
policy.MaximumExtentCount = 6;
// Set the minimum extents the log can have.
policy.MinimumExtentCount = 2;
// Set the prefix for new containers that are added.
// when AutoGrow is enabled.
//policy.NewExtentPrefix = "MyLogPrefix";
// Set the suffix number for new containers that are added.
// when AutoGrow is enabled.
policy.NextExtentSuffix = 3;
// Commit the log policy.
policy.Commit();
// Refresh updates the IO.Log policy properties with current log policy
// set in the log.
policy.Refresh();
// LOG POLICY END
//
' SET LOG POLICY
Dim policy As LogPolicy = sequence.LogStore.Policy
' Set AutoGrow policy. This enables the log to automatically grow
' when the existing extents are full. New extents are added until
' we reach the MaximumExtentCount extents.
' AutoGrow policy is supported only in Windows Vista and not available in R2.
'policy.AutoGrow = true;
' Set the Growth Rate in terms of extents. This policy specifies
' "how much" the log should grow.
policy.GrowthRate = New PolicyUnit(2, PolicyUnitType.Extents)
' Set the AutoShrink policy. This enables the log to automatically
' shrink if the available free space exceeds the shrink percentage.
' AutoGrow/shrink policy is supported only in Windows Vista and not available in R2.
'policy.AutoShrinkPercentage = new PolicyUnit(30, PolicyUnitType.Percentage);
' Set the PinnedTailThreshold policy.
' A tail pinned event is triggered when there is no
' log space available and log space may be freed by advancing the base.
' The user must handle the tail pinned event by advancing the base of the log.
' If the user is not able to move the base of the log, the user should report with exception in
' the tail pinned handler.
' PinnedTailThreashold policy dictates the amount of space that the TailPinned event requests
' for advancing the base of the log. The amount of space can be in percentage or in terms of bytes
' which is rounded off to the nearest containers in CLFS. The default is 35 percent.
policy.PinnedTailThreshold = New PolicyUnit(10, PolicyUnitType.Percentage)
' Set the maximum extents the log can have.
policy.MaximumExtentCount = 6
' Set the minimum extents the log can have.
policy.MinimumExtentCount = 2
' Set the prefix for new containers that are added.
' when AutoGrow is enabled.
'policy.NewExtentPrefix = "MyLogPrefix";
' Set the suffix number for new containers that are added.
' when AutoGrow is enabled.
policy.NextExtentSuffix = 3
' Commit the log policy.
policy.Commit()
' Refresh updates the IO.Log policy properties with current log policy
' set in the log.
policy.Refresh()
' LOG POLICY END
'
Opmerkingen
Een beleid is een set regels die moeten worden gevolgd door een LogStore exemplaar en de bijbehorende clients. Een LogPolicy exemplaar wordt gebruikt om het beleid dat is gekoppeld aan een specifiek LogStorebeleid te onderzoeken en te wijzigen. Een beleid kan de minimale en maximale toegestane logboekgrootten beschrijven of hoe het LogStore exemplaar mag groeien. Daarnaast kunt u ook bepalen of een LogStore exemplaar kan worden gearchiveerd.
Nadat u een van de eigenschappen hebt gewijzigd, moet u de Commit methode gebruiken om ervoor te zorgen dat de wijzigingen worden toegepast op de LogStore. U kunt de Refresh methode aanroepen om wijzigingen te negeren of om het meest recente beleid op te halen.
Eigenschappen
| Name | Description |
|---|---|
| AutoGrow |
Hiermee wordt een waarde opgehaald of ingesteld die aangeeft of de LogStore waarde automatisch kan groeien. |
| AutoShrinkPercentage |
Hiermee haalt of stelt u het percentage vrije ruimte in dat kan LogStore worden verkleind. |
| GrowthRate |
Hiermee haalt of stelt u de snelheid van automatische groei van de LogStore. |
| MaximumExtentCount |
Hiermee haalt u het maximum aantal LogExtent exemplaren op of stelt u LogStore deze in. |
| MinimumExtentCount |
Hiermee haalt of stelt u het minimum aantal LogExtent exemplaren op dat de LogStore exemplaren kunnen bevatten. |
| NewExtentPrefix |
Hiermee haalt u de tekenreeks voor het voorvoegsel op of stelt u deze in voor automatisch gemaakte gebieden. |
| NextExtentSuffix |
Hiermee haalt u het achtervoegselnummer voor nieuwe gebieden op of stelt u dit in. |
| PinnedTailThreshold |
Hiermee haalt u de hoeveelheid ruimte op die de TailPinned gebeurtenis nodig heeft om de basis van het logboek door te gaan. |
Methoden
| Name | Description |
|---|---|
| Commit() |
Hiermee stelt u dit beleid in als het huidige beleid voor de LogStore. |
| Equals(Object) |
Bepaalt of het opgegeven object gelijk is aan het huidige object. (Overgenomen van Object) |
| GetHashCode() |
Fungeert als de standaardhashfunctie. (Overgenomen van Object) |
| GetType() |
Hiermee haalt u de Type huidige instantie op. (Overgenomen van Object) |
| MemberwiseClone() |
Hiermee maakt u een ondiepe kopie van de huidige Object. (Overgenomen van Object) |
| Refresh() |
Leest het huidige beleid voor de LogStore, waarbij wijzigingen die zijn aangebracht, worden genegeerd. |
| ToString() |
Retourneert een tekenreeks die het huidige object vertegenwoordigt. (Overgenomen van Object) |