Closed TIPConsulting closed 3 years ago
As I know, logging provider is not obligated to support scopes (even some built-in logging providers don't support scopes).
If you have a vision how to add scopes support to NReco.Logging.File (with a backward compatibility) your contribution is welcome.
I'll see what I can do
My plan for now is to leave the default output formatter as-is. I will add a scope collection to the LogMessage objects and users can implement a custom output formatter to write them to file if required
It seems scopes may add some overhead (even if scopes are not used in the app) and, actually, anyway require custom formatting, and this is not what I want for the lightweight and simple file logging provider.
Anyone who is looking for the scopes support may check @TIPConsulting implementation (thanks for that!): https://github.com/nreco/logging/pull/20
Would it be possible to add Scope support? I'm not quite sure what level of effort it entails, but these pages seem to lay out a basic implementation
https://www.meziantou.net/asp-net-core-json-logger.htm
https://www.codeproject.com/Articles/1556475/How-to-Write-a-Custom-Logging-Provider-in-ASP-NET