In my attempts to get this working in my project I encountered a few problems. I've included my solutions here for consideration.
My logs included the message template, but not the rendered message - To resolve I've added the rendered message to the payload send to LA
I was unable to set configuration settings (initially found when trying to adjust the JSON Serializer) - I've passed on the configuration settings provided by the caller and only create a new one if none is provided by the calling code.
The System.Text.JSON serializer was not able to serialize the Serilog.LogEventProperty objects meaning the log property values were missing from my logs. - I've added support for using one of the JSON Formatters (with the ITextFormatter interface) provided by Serilog to format the JSON sent to LA
Note that point 3 does significantly change the format of the event sent to LA, however I believe it was previously failing to send much of the information.
In my attempts to get this working in my project I encountered a few problems. I've included my solutions here for consideration.
System.Text.JSON
serializer was not able to serialize theSerilog.LogEventProperty
objects meaning the log property values were missing from my logs. - I've added support for using one of the JSON Formatters (with theITextFormatter
interface) provided by Serilog to format the JSON sent to LANote that point 3 does significantly change the format of the event sent to LA, however I believe it was previously failing to send much of the information.