Open daveaglick opened 5 years ago
On the one hand I absolutely agree with you, but I'm a bit conflicted.
The implementation of BatchingLogger
is pretty much a direct copy from the implementation in the aspnet/Extensions repo. That was intentional, as I can just pull in any tweaks from there into this library - it may not be the best implementation but it does the job. This whole library was really just a proof of concept - I generally recommend people use Serilog for file logging instead of this library!
That said, it is being used, and so probably should be improved when there's obvious deficiencies in it like this.
That's a long winded way of me saying yes, I like it, thanks 😉
I love the general intent behind
BatchingLogger
andBatchingLoggerProvider
but they suffer from some of the same problems as the stockConsoleLogger
in that the actual message is created within theBatchingLogger
and can't be customized. I'd love to use the classes as the basis for totally customized logging (I.e., my own console logger). My proposal:LogMessage
to the following:Log
method inBatchingLogger
to:WriteMessagesAsync
method in eachBatchingLoggerProvider
implementation.The idea is that the
FileLoggerProvider
would then generate the message string insideWriteMessagesAsync
the way theBatchingLogger
used to using the new properties inLogMessage
. Any new implementation could render the message string however they want to since theLogMessage
now contains all the information like log level.What do you think?