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

Implement high-performance logging #193

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Implement high-performance logging #193

merged 3 commits into from
Mar 22, 2024

Conversation

Jonnern
Copy link
Contributor

@Jonnern Jonnern commented Mar 18, 2024

This pull request adds high-performance logging
https://learn.microsoft.com/en-us/dotnet/core/extensions/high-performance-logging

Advantages:

  • Reduces memory allocation and garbage collection for logging
  • Faster logging
  • Each LoggerMessage has an EventId which can used for filtering logs in the logging target
  • Has a great positive impact on hot paths

Cons:

  • Lower readability than using ILogger.Log directly
  • Not easy to reuse/look up existing logging extension methods
  • Harder to see which log level a logline has

Note:

Event IDs are grouped by categories which makes it possible to get all logs coming from one of these clients by filtering by ID ranges

  • CryptoExchangeWebSocketClient: Id 1000-1999
  • SocketConnection: Id 2000-2999
  • SocketApiClient: Id 3000-3999
  • RestApiClient: Id 4000-4999
  • SymbolOrderBook: Id 5000-5999

@JKorf
Copy link
Owner

JKorf commented Mar 21, 2024

I added a small change to one of the log statements, could you resolve the conflict?

@JKorf JKorf merged commit de72fe4 into JKorf:master Mar 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants