|
Este artículo se tradujo de forma manual. Mueva el puntero sobre las frases del artículo para ver el texto original.
|
Traducción
Original
|
EventLog.ModifyOverflowPolicy (Método)
Ensamblado: System (en System.dll)
[ComVisibleAttribute(false)] public void ModifyOverflowPolicy( OverflowAction action, int retentionDays )
Parámetros
- action
- Tipo: System.Diagnostics.OverflowAction
Comportamiento de desbordamiento para la escritura de entradas nuevas en el registro de eventos.
- retentionDays
- Tipo: System.Int32
Número mínimo de días que se conserva cada entrada del registro de eventos. Sólo se utiliza este parámetro si action se establece en OverwriteOlder.
| Excepción | Condición |
|---|---|
| InvalidEnumArgumentException |
|
| ArgumentOutOfRangeException |
|
| InvalidOperationException |
Nota |
|---|
Nota |
|---|
Precaución |
|---|
// Display the current event log overflow settings, and // prompt the user to input a new overflow setting. public static void ChangeEventLogOverflowAction(String logName) { if (EventLog.Exists(logName)) { // Display the current overflow setting of the // specified event log. EventLog inputLog = new EventLog(logName); Console.WriteLine(" Event log {0}", inputLog.Log); OverflowAction logOverflow = inputLog.OverflowAction; Int32 numDays = inputLog.MinimumRetentionDays; Console.WriteLine(" Current overflow setting = {0}", logOverflow.ToString()); if (logOverflow == OverflowAction.OverwriteOlder) { Console.WriteLine("\t Entries are retained a minimum of {0} days.", numDays.ToString()); } // Prompt user for a new overflow setting. GetNewOverflowSetting(ref logOverflow, ref numDays); // Change the overflow setting on the event log. if (logOverflow != inputLog.OverflowAction) { inputLog.ModifyOverflowPolicy(logOverflow, numDays); Console.WriteLine("Event log overflow policy was modified successfully!"); } else { Console.WriteLine("Event log overflow policy was not modified."); } } else { Console.WriteLine("Event log {0} was not found.", logName); } }
- EventLogPermission
para administrar la información del registro de eventos en el equipo. Enumeración asociada: EventLogPermissionAccess.Administer
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Nota