Describe the story, please be clear on scope of the story.
At Agent startup, prior to the call to LoggerBootstrapper.Configure(), we need to capture log messages in memory, which will then be captured and propagated to the "real" logger that gets created in .Configure().
A NuGet package called Serilog.Sinks.InMemory exists, but only targets netstandard20. So we need to either implement our own simple in-memory sink or potentially fork the code for the Serilog.Sinks.InMemory package and modify it to support netframework462 as well as netstandard20. Note that the existing package was really designed for use in unit test scenarios, so contains much more functionality than we really need -- the only part we really need is the InMemorySink object and it's LogEvents property, so it may be easier to just copy the code directly into the Core project and give proper attribution to the author.
After implementing the in-memory sink, modify the logger configuration in LoggerBootstrapper.Initialize() to configure the logger to use that sink. Then add code in LoggerBootstrapper.Configure() to extract log messages captured by the in-memory sink and echo them to the "real" logger.
Acceptance Criteria
Messages logged at startup, prior to calling LoggerBootstrapper.Configure() should be captured in the agent logfile.
Describe the story, please be clear on scope of the story.
At Agent startup, prior to the call to
LoggerBootstrapper.Configure()
, we need to capture log messages in memory, which will then be captured and propagated to the "real" logger that gets created in.Configure()
.A NuGet package called
Serilog.Sinks.InMemory
exists, but only targetsnetstandard20
. So we need to either implement our own simple in-memory sink or potentially fork the code for theSerilog.Sinks.InMemory
package and modify it to supportnetframework462
as well asnetstandard20
. Note that the existing package was really designed for use in unit test scenarios, so contains much more functionality than we really need -- the only part we really need is theInMemorySink
object and it'sLogEvents
property, so it may be easier to just copy the code directly into the Core project and give proper attribution to the author.Potentially helpful URLs: https://github.com/serilog/serilog/wiki/Developing-a-sink https://github.com/serilog-contrib/SerilogSinksInMemory
After implementing the in-memory sink, modify the logger configuration in
LoggerBootstrapper.Initialize()
to configure the logger to use that sink. Then add code inLoggerBootstrapper.Configure()
to extract log messages captured by the in-memory sink and echo them to the "real" logger.Acceptance Criteria
Messages logged at startup, prior to calling
LoggerBootstrapper.Configure()
should be captured in the agent logfile.Estimates
Please provide initial t-shirt size M