Skip to content

Commit

Permalink
Fix health check logging
Browse files Browse the repository at this point in the history
The Coalesce(StatusCode, 200) was removing all internal healthcheck logs except the response
  • Loading branch information
SapiensAnatis committed May 10, 2024
1 parent 6aa09b5 commit 7d8efc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions DragaliaAPI/DragaliaAPI/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
{
"Name": "ByExcluding",
"Args": {
"expression": "EndsWith(RequestPath, '/health') and Coalesce(StatusCode, 200)=200"
"expression": "EndsWith(RequestPath, '/health') and @l in ['verbose', 'debug', 'information'] ci"
}
},
{
"Name": "ByExcluding",
"Args": {
"expression": "EndsWith(RequestPath, '/ping') and Coalesce(StatusCode, 204)=204"
"expression": "EndsWith(RequestPath, '/ping') and @l in ['verbose', 'debug', 'information'] ci"
}
}
],
Expand All @@ -30,7 +30,7 @@
"Args": {
"formatter": {
"type": "Serilog.Templates.ExpressionTemplate, Serilog.Expressions",
"template": "[{@t:yyyy-MM-dd HH:mm:ss} {@l:u3} {Substring(SourceContext, LastIndexOf(SourceContext, '.') + 1)}{#each i in [RequestId, AccountId, ViewerId]}{Concat(' ', i)}{#end}] {@m}\n{@x}"
"template": "[{@t:yyyy-MM-dd HH:mm:ss} {@l} {RequestPath} {Substring(SourceContext, LastIndexOf(SourceContext, '.') + 1)}{#each i in [RequestId, AccountId, ViewerId]}{Concat(' ', i)}{#end}] {@m}\n{@x}"
},
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console"
}
Expand Down
4 changes: 2 additions & 2 deletions PhotonStateManager/DragaliaAPI.Photon.StateManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
config.Enrich.FromLogContext();
config.Filter.ByExcluding(
"EndsWith(RequestPath, '/health') and Coalesce(StatusCode, 200) = 200"
"EndsWith(RequestPath, '/health') and @l in ['verbose', 'debug', 'information'] ci"
);
config.Filter.ByExcluding(
"EndsWith(RequestPath, '/ping') and Coalesce(StatusCode, 200) = 200"
"EndsWith(RequestPath, '/ping') and @l in ['verbose', 'debug', 'information'] ci"
);
}
);
Expand Down

0 comments on commit 7d8efc4

Please sign in to comment.