Closed hbiarge closed 4 years ago
Thanks for opening this, can I know why it's not recommended ?
The main reason is this (from the docs page https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.2#log-message-template)
"The logging framework works this way so that logging providers can implement semantic logging, also known as structured logging. The arguments themselves are passed to the logging system, not just the formatted message template. This information enables logging providers to store the parameter values as fields."
If you pass the formatted string, logger providers can´t identify those important values.
Hope this helps!
Thanks for taking the time to PR this.
Please, don´t use string interpolation when logging operations:
Use always structured logging syntax to better performance and improve clarity with log stores that support structured logging. For example: