Skip to content

Conversation

@ManickaP
Copy link
Member

They were just containing the very same information as the LogLevel and having them specified prevents dotnet trace to collect the logs without masking for them in flags (see :0xf):

dotnet trace collect -p <pid> --providers Private.InternalDiagnostics.System.Net.Security:0xf,...

Tested manually.

cc @rzikm

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes unnecessary Keywords properties from internal log events in System.Net libraries. The Keywords were redundant with the LogLevel information and their presence required dotnet trace to explicitly mask for them using flags (:0xf), making log collection more cumbersome.

Changes:

  • Removed the Keywords class definition from NetEventSource.Common.cs
  • Removed Keywords = Keywords.Default or Keywords = Keywords.Debug parameters from all Event attributes across System.Net libraries
  • Applied changes consistently to production code and test logging infrastructure

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
NetEventSource.Common.cs Removed the Keywords class definition that contained Default and Debug keyword constants
NetEventSource.Common.DumpBuffer.cs Removed Keywords parameter from DumpBuffer event attribute
NetEventSource.Common.Associate.cs Removed Keywords parameter from Associate event attribute
NetEventSource.Security.cs Removed Keywords parameter from 27 Security-related event attributes
NetEventSource.Security.Windows.cs Removed Keywords parameter from 8 Windows Security-related event attributes
NetEventSource.Http.cs Removed Keywords parameter from 8 HTTP-related event attributes
NetEventSource.Sockets.cs Removed Keywords parameter from 4 Socket-related event attributes
NetEventSource.WebSockets.cs Removed Keywords parameter from 14 WebSocket-related event attributes
EventSourceTestLogging.cs Removed Keywords parameter from 3 test event attributes

Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@rzikm rzikm left a comment

Choose a reason for hiding this comment

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

LGTM, too bad we still need to keep using the flags for existing releases.

Do we have any public documentation talking about these internal diagnostics which we should update?

@MihaZupan
Copy link
Member

We mention it here https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/telemetry/events#internal-diagnostics, but just via the EventListener API. We could add a snippet for how to do it with dotnet trace.

@ManickaP
Copy link
Member Author

dotnet/docs#51284 We'll need to update with .NET 11 though.

@ManickaP
Copy link
Member Author

/ba-g enterprise tests are unrelated

@ManickaP ManickaP merged commit b8effac into dotnet:main Jan 22, 2026
94 of 96 checks passed
@ManickaP ManickaP deleted the fix-logging branch January 22, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants