LogPolicy Sınıf

Tanım

ile LogStoreilişkili ilkeyi temsil eder.

public ref class LogPolicy sealed
public sealed class LogPolicy
type LogPolicy = class
Public NotInheritable Class LogPolicy
Devralma
LogPolicy

Örnekler

Bu örnekte, bir günlük kaydı dizisi için ilke ayarlamak üzere sınıfının nasıl kullanılacağı LogPolicy gösterilmektedir.

// 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
'

Açıklamalar

İlke, bir örnek ve istemcileri tarafından takip edilecek kurallar LogStore kümesidir. Bir LogPolicy örnek, belirli LogStorebir ile ilişkili ilkeyi incelemek ve değiştirmek için kullanılır. İlke, izin verilen en düşük ve en yüksek günlük boyutlarını veya örneğin nasıl LogStore büyümesine izin verilip verilmeyeceğini açıklayabilir. Ayrıca, örneğin LogStore arşivlenip arşivlenmediğini de denetleyebilirsiniz.

Özelliklerden herhangi birini değiştirdikten sonra, değişikliklerin öğesine uygulandığından emin olmak için LogStoreyöntemini kullanmalısınızCommit. Değişiklikleri atmak veya en güncel ilkeyi almak için yöntemini çağırabilirsiniz Refresh .

Özellikler

AutoGrow

öğesinin otomatik olarak büyüyebileceğini LogStore belirten bir değer alır veya ayarlar.

AutoShrinkPercentage

Küçülebilecek boş alan LogStore yüzdesini alır veya ayarlar.

GrowthRate

otomatik büyüme LogStoreoranını alır veya ayarlar.

MaximumExtentCount

içerebileceği en fazla örnek LogStore sayısını LogExtent alır veya ayarlar.

MinimumExtentCount

öğesinin içerebileceği en az örnek LogStore sayısını LogExtent alır veya ayarlar.

NewExtentPrefix

Otomatik olarak oluşturulan kapsamlar için ön ek dizesini alır veya ayarlar.

NextExtentSuffix

Yeni kapsamlar için sonek numarasını alır veya ayarlar.

PinnedTailThreshold

Olayın günlüğün tabanını TailPinned ilerletilmesi için gereken alan miktarını alır veya ayarlar.

Yöntemler

Commit()

Bu ilkeyi için LogStoregeçerli ilke olarak ayarlar.

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
Refresh()

için geçerli ilkeyi LogStoreokur ve yapılmış olabilecek değişiklikleri atar.

ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır