diff --git a/xml/System.Diagnostics/EventLog.xml b/xml/System.Diagnostics/EventLog.xml index 0b21674e876..675f0ee02b5 100644 --- a/xml/System.Diagnostics/EventLog.xml +++ b/xml/System.Diagnostics/EventLog.xml @@ -2510,22 +2510,18 @@ SVC_UPDATE.EXE System.Int32 - Gets the number of days to retain entries in the event log. - The number of days that entries in the event log are retained. The default value is 7. + This property is deprecated. + To be added. - property to examine the current setting for an event log. Use to change the minimum number of days that each entry in the event log must be retained. - - The value depends on the configured overflow behavior of the event log. If the property for an event log is set to , then the value is 0. If the property for an event log is set to , then the value is -1. If the property for an event log is set to , then the value is greater than zero, and represents the number of days to retain event log entries when the event log is full. + has its set to , and the event log reaches its maximum size, then new entries are written only if they can replace entries whose age exceeds the period. Retaining event entries for a minimum period is appropriate when the event log is archived regularly. Otherwise, you risk losing new entries when the event log reaches its limit. To avoid losing new event information, set the minimum retention days for events based on your archive schedule for a particular event log. - - - -## Examples - The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log. +> [!IMPORTANT] +> Support for the property was removed in Windows Vista and later operating systems. Setting this value can cause the Event Log to never overwrite events, and to drop all events to the channel once it is full. + +## Examples + The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/EventLogProperties/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs" id="Snippet2"::: @@ -2576,8 +2572,8 @@ SVC_UPDATE.EXE - The overflow behavior for writing new entries to the event log. - The minimum number of days each event log entry is retained. This parameter is used only if is set to . + The overflow behavior for writing new entries to the event log. Must not be `OverwriteOlder`. + Deprecated. Must be 0. Changes the configured behavior for writing new entries when the event log reaches its maximum file size. [!NOTE] -> The overflow behavior takes effect only when an event log reaches its maximum file size. The overflow behavior does not affect writing a new entry to a log that can accommodate additional event log entries. +> The overflow behavior takes effect only when an event log reaches its maximum file size. The overflow behavior does not affect writing a new entry to a log that can accommodate additional event log entries. The method configures the overflow behavior of an event log. instance. After calling this method for the event log specified by the property, the and property values reflect the newly configured overflow behavior. > [!NOTE] -> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log. +> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log. + + Set the `action` parameter to to indicate that a new entry overwrites the oldest entry when the reaches its maximum size. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. - Set the `action` parameter to to indicate that a new entry overwrites the oldest entry when the reaches its maximum size. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. + Set the `action` parameter to to discard new events when the maximum log size is reached. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. - Set the `action` parameter to to indicate that each new entry overwrites older entries when the reaches its maximum size. Specify the number of days that events must be retained in the log using the `retentionDays` parameter. Events written within the retention range are not overwritten by new entries. - - Set the `action` parameter to to discard new events when the maximum log size is reached. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. +> [!WARNING] +> Never set the `action` parameter to . This value is deprecated and might cause the log to behave as if the `DoNotOverwrite` parameter was passed instead. > [!CAUTION] -> Setting the overflow policy to specifies that new entries are discarded when the event log is full. If you use this setting, ensure the event log is regularly archived and cleared to avoid reaching its maximum size limit. - - +> Setting the overflow policy to specifies that new entries are discarded when the event log is full. If you use this setting, ensure the event log is regularly archived and cleared to avoid reaching its maximum size limit. ## Examples The following example displays the configured overflow policy for a specified event log, and allows the user to select a new overflow policy setting for the event log. diff --git a/xml/System.Diagnostics/OverflowAction.xml b/xml/System.Diagnostics/OverflowAction.xml index 4b3b0b16ad6..583a46739b5 100644 --- a/xml/System.Diagnostics/OverflowAction.xml +++ b/xml/System.Diagnostics/OverflowAction.xml @@ -38,12 +38,13 @@ - New entries will be discarded. -- New entries will overwrite older entries. - -- New entries will either be discarded or will overwrite existing entries depending upon the age of the existing entries. +- New entries will overwrite older entries. Use the method to set the overflow behavior for an . Check the current configured behavior of an through its property. +> [!WARNING] +> The `OverwriteOlder` behavior is deprecated. Using this value might cause the Event Log to behave as if the `DoNotOverwrite` value was used instead, which will cause events to be discarded when the log is full. + ## Examples The following example enumerates the event logs defined on the local computer and displays configuration details for each event log. @@ -149,17 +150,17 @@ The following example enumerates the event logs defined on the local computer an 1 - Indicates that new events overwrite events older than specified by the property value when the event log is full. New events are discarded if the event log is full and there are no events older than specified by the property value. + This field is deprecated. [!WARNING] +> Do not use this value. Doing so might cause the Event Log to behave as if the `DoNotOverwrite` value was used instead. ]]> -