Skip to content

Commit

Permalink
Logging update (API + WEB)
Browse files Browse the repository at this point in the history
Log only errors to file
  • Loading branch information
crni99 committed Sep 15, 2024
1 parent 500ad42 commit 20de732
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task<bool> Authenticate(UserViewModel user)
}
else if (((int)response.StatusCode) == 400 || ((int)response.StatusCode) == 401)
{
_logger.LogError("Unauthorized");
_logger.LogInformation("Unauthorized. Status code: {StatusCode}", response.StatusCode);
}
else
{
Expand Down
17 changes: 2 additions & 15 deletions AirportAutomation/AirportAutomationWeb/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,8 @@
"Args": {
"path": "Logs/AirportAutomationAPI-.txt",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {CorrelationId} {Message}{NewLine}{Exception}"
}
}
],
"Filter": [
{
"Name": "ExpressionFilter",
"Args": {
"expression": "Level >= Information"
}
},
{
"Name": "ExpressionFilter",
"Args": {
"expression": "Level >= Warning"
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {CorrelationId} {Message}{NewLine}{Exception}",
"restrictedToMinimumLevel": "Error"
}
}
]
Expand Down
17 changes: 2 additions & 15 deletions AirportAutomation/AirportАutomationApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,8 @@
"Args": {
"path": "Logs/AirportAutomationAPI-.txt",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {CorrelationId} {Message}{NewLine}{Exception}"
}
}
],
"Filter": [
{
"Name": "ExpressionFilter",
"Args": {
"expression": "Level >= Information"
}
},
{
"Name": "ExpressionFilter",
"Args": {
"expression": "Level >= Warning"
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {CorrelationId} {Message}{NewLine}{Exception}",
"restrictedToMinimumLevel": "Error"
}
}
]
Expand Down

0 comments on commit 20de732

Please sign in to comment.