You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTPSysServer does not use LoggerMessage.Define #31313
LoggerMessage.Define is the preferred approach to logging as it saves re-parsing format strings and doing dictionary lookups (and potential allocations if the cache isn't full). We should update the log calls to use it.
Sounds good. Are you aware of the latest pattern we've been using? It's a nested static Log class with static methods that do logging. If the class is big enough we make a partial class and put the log methods in there m. If that's not clear, take a look at SignalR
Activity
[-]HTTPSys server does not use LoggerMessage.Define[/-][+]HTTPSysServer does not use LoggerMessage.Define[/+]martincostello commentedon Mar 28, 2021
Happy to pick this up if you've not already started on it.
davidfowl commentedon Mar 28, 2021
Sounds good. Are you aware of the latest pattern we've been using? It's a nested static Log class with static methods that do logging. If the class is big enough we make a partial class and put the log methods in there m. If that's not clear, take a look at SignalR
martincostello commentedon Mar 28, 2021
I took a look at the repo and saw that there's a class called
LoggingExtensions(example) and then the messages are defined in there.If you're moving to nested per-class instead I'll do it that way instead 👍
davidfowl commentedon Mar 28, 2021
E.g.
aspnetcore/src/Servers/IIS/IIS/src/Core/IISHttpContext.Log.cs
Line 12 in 155f402
aspnetcore/src/SignalR/clients/csharp/Http.Connections.Client/src/Internal/SendUtils.cs
Line 112 in 46359cd
davidfowl commentedon Mar 28, 2021
Assigned the issue to you @martincostello
Use LoggerMessage.Define in HttpSys
Use LoggerMessage.Define in HttpSys (#31333)
davidfowl commentedon Mar 28, 2021
Thanks!
PR (#2)