You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.Diagnostics/EventLog.xml
+9-13Lines changed: 9 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -2500,17 +2500,13 @@ SVC_UPDATE.EXE
2500
2500
<ReturnType>System.Int32</ReturnType>
2501
2501
</ReturnValue>
2502
2502
<Docs>
2503
-
<summary>Gets the number of days to retain entries in the event log.</summary>
2504
-
<value>The number of days that entries in the event log are retained. The default value is 7.</value>
2503
+
<summary>Deprecated</summary>
2504
+
<value>Deprecated</value>
2505
2505
<remarks>
2506
2506
<formattype="text/markdown"><![CDATA[
2507
2507
2508
2508
## Remarks
2509
-
Use the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> property to examine the current setting for an event log. Use <xref:System.Diagnostics.EventLog.ModifyOverflowPolicy%2A> to change the minimum number of days that each entry in the event log must be retained.
2510
-
2511
-
The <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value depends on the configured overflow behavior of the event log. If the <xref:System.Diagnostics.OverflowAction> property for an event log is set to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded>, then the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value is 0. If the <xref:System.Diagnostics.OverflowAction> property for an event log is set to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite>, then the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value is -1. If the <xref:System.Diagnostics.OverflowAction> property for an event log is set to <xref:System.Diagnostics.OverflowAction.OverwriteOlder>, then the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value is greater than zero, and represents the number of days to retain event log entries when the event log is full.
2512
-
2513
-
The overflow behavior only occurs when an event log reaches its size limit. When an <xref:System.Diagnostics.EventLog> has its <xref:System.Diagnostics.EventLog.OverflowAction%2A> set to <xref:System.Diagnostics.OverflowAction.OverwriteOlder>, and the event log reaches its maximum size, then new entries are written only if they can replace entries whose age exceeds the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> 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.
2509
+
Support for the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> 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.
<paramname="action">The overflow behavior for writing new entries to the event log.</param>
2569
-
<paramname="retentionDays">The minimum number of days each event log entry is retained. This parameter is used only if <paramrefname="action" /> is set to <seecref="F:System.Diagnostics.OverflowAction.OverwriteOlder" />.</param>
2570
-
<summary>Changes the configured behavior for writing new entries when the event log reaches its maximum file size.</summary>
2564
+
<paramname="action">The overflow behavior for writing new entries to the event log. Must not be `OverwriteOlder`.</param>
2565
+
<paramname="retentionDays">Deprecated. Must be 0.</summary>
2571
2566
<remarks>
2572
2567
<formattype="text/markdown"><![CDATA[
2573
2568
@@ -2583,10 +2578,11 @@ SVC_UPDATE.EXE
2583
2578
> 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.
2584
2579
2585
2580
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded> to indicate that a new entry overwrites the oldest entry when the <xref:System.Diagnostics.EventLog> reaches its maximum size. If the `action` parameter is set to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded>, the `retentionDays` parameter value is ignored.
2586
-
2587
-
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteOlder> to indicate that each new entry overwrites older entries when the <xref:System.Diagnostics.EventLog> 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.
2588
-
2581
+
2589
2582
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite> to discard new events when the maximum log size is reached. If the `action` parameter is set to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite>, the `retentionDays` parameter value is ignored.
2583
+
2584
+
> [!WARNING]
2585
+
> Never set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteOlder>. This value is deprecated and may cause the log to behave as if the `DoNotOverwrite` parameter was passed instead.
2590
2586
2591
2587
> [!CAUTION]
2592
2588
> Setting the overflow policy to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite> 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.
0 commit comments