Skip to content
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

Update logging to use generated logs #2529

Closed
JamesNK opened this issue Sep 9, 2024 · 0 comments · Fixed by #2531
Closed

Update logging to use generated logs #2529

JamesNK opened this issue Sep 9, 2024 · 0 comments · Fixed by #2531
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JamesNK
Copy link
Member

JamesNK commented Sep 9, 2024

Logging makes heavy use of LoggerMessage.Define. It provides named, structured logging with good performance.
https://github.com/grpc/grpc-dotnet/blob/3ed9fb9f31474b4d1318051123a37d9b6f68cda4/src/Grpc.AspNetCore.Server/Internal/GrpcServerLog.cs

Logging code can be simplified and reduced by using generated logs:
https://learn.microsoft.com/en-us/dotnet/core/extensions/logger-message-generator

I think now that Microsoft.Extensions.Logging is 6.0+ we should be able to use this feature.

Note that there are a lot of logs. It will be a fair bit of work to do all of them. I don't think there is anything stopping one type at a time from being updated.

@JamesNK JamesNK added help wanted Extra attention is needed enhancement New feature or request labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant