I am attempting to create a custom template for logging JSON format and writing it to a file using the following tech stack in my environment:
- DotNet 6 - WebAPI
- Serilog
My expectation for the log file is to have the following format:
{"level":"info","message":"order confirmation email sent to \"jack@example.com\"","service":"checkoutservice","span_id":"197492ff2b4e1c65","timestamp":"2022-10-10T22:17:14.841359661Z","trace_id":"e12c408e028299900d48a9dd29b0dc4c"}
Please advise me on how to define the template in my appsettings.json file.