Last update:
January 21, 2025
How to update platform to Serilog integrated version¶
Note
Along with updating platform to 3.304.0 version you have to update xAPI module to version 3.314.0 or higher.
To update your platform version to 3.304.0 and higher, use one of the following options:
Option 1. Migrate existing configuration to Serilog format¶
If you committed changes to logging configuration:
- Map existing configuration into Serilog format in the appsettings.{ENVIRONMENT}.json Logging section.
- Replace the original configuration with the Serilog configuration.
Below are examples of the appsettings.{ENVIRONMENT}.json file before and after migration:
Before:
appsettings.{ENVIRONMENT}.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
After:
appsettings.{ENVIRONMENT}.json
{
"Serilog": {
"Using": [
"Serilog.Sinks.Console"
],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console"
}
]
}
}
Serilog Settings Configuration
Option 2. Use Application Insights¶
Since Application Insights integration was moved to a separate module:
-
Add the following changes to the appsettings.{ENVIRONMENT}.json file.
appsettings.{ENVIRONMENT}.json
{
"Serilog": {
"Using": [
"Serilog.Sinks.ApplicationInsights"
],
"WriteTo": [
{
"Name": "ApplicationInsights",
"Args": {
"connectionString": "<Copy connection string from Application Insights Resource Overview>",
"telemetryConverter": "Serilog.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights",
"restrictedToMinimumLevel": "Error"
}
}
]
}
}