Skip to content

Fix descriptions of invalid eventlog overflow policy #9293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 12, 2025

Conversation

Robo210
Copy link
Contributor

@Robo210 Robo210 commented Sep 14, 2023

Support for "Retain events older than X days" was dropped in Windows Vista (and it only ever almost worked on XP/Server 2003). This was a breaking change made roughly 15 years ago, and the new policy is documented as being strictly incompatible with the old retention setting:

  • XP/2003: Set reg value to 0 for "overwrite based on log size", > 0 for "overwrite based on the value as a time", and -1 for "never overwrite events"
  • Vista onward: Set reg value to 0 for "overwrite based on log size" and any non-zero value for "never overwrite events".

Encouraging people to continue to try to utilize the XP/2003 behavior of setting a time will in fact make the system never overwrite events at all, which in turn will break the system when other security policies are applied (e.g. "don't allow users to log in when the security log is full" or "bug check the machine when a security event is lost").

This change does not fully remove every reference to the old behaviors across the entire code base, but it is a start.

See the description of the Retention value at https://learn.microsoft.com/en-us/windows/win32/eventlog/eventlog-key for details.

Support for "Retain events older than X days" was dropped in Windows Vista (and it only ever almost worked on XP/Server 2003). This was a breaking change made roughly 15 years ago, and the new policy is documented as being strictly incompatible with the old retention setting:
  - XP/2003: Set reg value to 0 for "overwrite based on log size", > 0 for "overwrite based on the value as a time", and -1 for "never overwrite events"
  - Vista onward: Set reg value to 0 for "overwrite based on log size" and any non-zero value for "never overwrite events".

Encouraging people to continue to try to utilize the XP/2003 behavior of setting a time will in fact make the system never overwrite events at all, which in turn will break the system when other security policies are applied (e.g. "don't allow users to log in when the security log is full" or "bug check the machine when a security event is lost").

This change does not fully remove every reference to the old behaviors across the entire code base, but it is a start.

See the description of the Retention value at https://learn.microsoft.com/en-us/windows/win32/eventlog/eventlog-key for details.
@Robo210 Robo210 requested a review from a team as a code owner September 14, 2023 22:20
@ghost ghost added community-contribution Indicates that the PR has been added by a community member area-System.Diagnostics labels Sep 14, 2023
@ghost
Copy link

ghost commented Sep 14, 2023

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Support for "Retain events older than X days" was dropped in Windows Vista (and it only ever almost worked on XP/Server 2003). This was a breaking change made roughly 15 years ago, and the new policy is documented as being strictly incompatible with the old retention setting:

  • XP/2003: Set reg value to 0 for "overwrite based on log size", > 0 for "overwrite based on the value as a time", and -1 for "never overwrite events"
  • Vista onward: Set reg value to 0 for "overwrite based on log size" and any non-zero value for "never overwrite events".

Encouraging people to continue to try to utilize the XP/2003 behavior of setting a time will in fact make the system never overwrite events at all, which in turn will break the system when other security policies are applied (e.g. "don't allow users to log in when the security log is full" or "bug check the machine when a security event is lost").

This change does not fully remove every reference to the old behaviors across the entire code base, but it is a start.

See the description of the Retention value at https://learn.microsoft.com/en-us/windows/win32/eventlog/eventlog-key for details.

Author: Robo210
Assignees: -
Labels:

area-System.Diagnostics, community-contribution

Milestone: -

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

antonfirsov
antonfirsov previously approved these changes Sep 15, 2023
Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM sorry, posted on the wrong issue.

@antonfirsov antonfirsov requested review from antonfirsov and removed request for antonfirsov September 15, 2023 14:53
@antonfirsov
Copy link
Member

/cc @tommcdon

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the deprecated methods be obsoleted instead of just setting the summary to "deprecated"? That way the docs would automatically show a banner similar to this: https://learn.microsoft.com/en-us/dotnet/api/system.codedom.compiler.codedomprovider.createcompiler?view=net-8.0#definition.

Co-authored-by: Genevieve Warren <[email protected]>
@Robo210
Copy link
Contributor Author

Robo210 commented Jun 6, 2024

Should the deprecated methods be obsoleted instead of just setting the summary to "deprecated"? That way the docs would automatically show a banner similar to this: https://learn.microsoft.com/en-us/dotnet/api/system.codedom.compiler.codedomprovider.createcompiler?view=net-8.0#definition.

That sounds like a good idea, but outside of my expertise. I am wary of causing build breaks for existing code (something we can't do in Win32 land, as much as I'd like to clear out a ton of obsolete nonsense); updating the docs at least lets support engineers point impacted customers in the correct direction. I am hoping the docs can also make it clear that this is deprecated/obsolete based on the Windows version the code is running on, not a specific .Net version (i.e. I don't want a customer to say "the docs claim it is obsolete in .net 9 but we're using .net framework 3 so clearly we're still good to use it").

This comment was marked as outdated.

This comment was marked as outdated.

@gewarren gewarren enabled auto-merge (squash) March 12, 2025 22:03
Copy link

Learn Build status updates of commit 4c1b573:

💡 Validation status: suggestions

File Status Preview URL Details
xml/System.Diagnostics/OverflowAction.xml 💡Suggestion View Details
xml/System.Diagnostics/EventLog.xml ✅Succeeded View

xml/System.Diagnostics/OverflowAction.xml

  • Line 0, Column 0: [Suggestion: ECMA2Yaml_Enum_NoRemarks] Please note: <remarks> node on Enum fields will be ignored.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@gewarren gewarren merged commit 2427e62 into dotnet:main Mar 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Diagnostics community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants