csharp: replace nlog with Microsoft.Extensions.Logging #593
eventhorizon-cli
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The logs of csharp client are written to files by default, and cannot be written only to the console, this is not very friendly to the .net developers.
The more commonly used logging system in .net sdk is Microsoft.Extensions.Logging.
https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line
The sdk can expose an API for configuring LoggerFactory, allowing users to configure it freely.
The design of EF Core can be referenced.
https://learn.microsoft.com/en-us/ef/core/logging-events-diagnostics/extensions-logging?tabs=v3#other-application-types
I tried to modify the logger in rocketmq client. Here is what it looks like after modification.
usages:
If possible, I would like to submit a PR, thanks.
Beta Was this translation helpful? Give feedback.
All reactions