This package offers an easy setup of serilog, with just a single line of code.
It is also useful in existing projects, where it would be an overhead to refactor each and every file to use serilog instead of MEL logger
- Sets up structured logging by replacing normal Microsoft Extensions Logging (MEL) with Serilog.
- Enriches the log context with the Application Name. Useful when working locally with multiple services.
- Writes logs to Applications Insights
- Writes logs to local SEQ instance for debugging.
The inspiration behind this package was the lack of structured logging support in Azure Functions V4 from MEL (especially logging custom properties in the log context) more here
https://www.nuget.org/packages/MariosSiati.StructuredLogging.Core/
Use the following extension method on IServiceCollection on app Startup:
UseSerilog(applicationName)
"seq": {
"ServerUrl": "http://localhost:5341",
"ApiKey": "1234567890",
"MinimumLevel": "Trace",
"LevelOverride": {
"Microsoft": "Debug"
}
}
.Net Core 6.0 .Net Functions Worker v4