Configure logging parameters in appsettings JSON file
- Last UpdatedMar 01, 2023
- 1 minute read
Configure serilog level and log retention parameters in the Web API appsettings JSON files if necessary.
To edit the appsettings files
-
Navigate to the Web Client root installation path and modify the relevant log sections of their individual appsettings.json files.
For example, C:\Program Files\AVEVA\AVEVA Production Management Web Client.
-
Authorization.Api
-
Configuration.Api
-
Downtime.Api
-
ShiftLog.Api
-
-
For each appsettings.json file, do the following and save changes to the file.
-
Update the serilog level based on your requirement. This indicates the minimum log level of messages to send to the logger application.
You can select either of these options: Verbose, Debug, Information, Warning, Error, or Fatal. The default level is Warning. If you set the level to Error, the Web Client triggers the HTTPContext information logging.
{
"Serilog": {
"MinimumLevel": {
"Default": "Warning",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
-
Update the log retention parameters or keep the default settings as shown in the following example. This example is extracted from the appsettings.json file from the DowntimeApi folder.
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "..\\Logs\\Downtime_.log",
"rollingInterval": "Day",
"rollOnFileSizeLimit": true,
"fileSizeLimitBytes": 104857600, //10 MB
"retainedFileCountLimit": 30,
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
}
}
-