I need the logs as follows
- Health Check should have single log entry for /health/live and /health/ready when Status 200. Currently 3 log entries for /health/live 3-10 log entries for /health/ready.
- Health Check should log all the warning and other Status code.
With no filters I could see the below logs
[11:19:19] [7b88516f-aa4b-4e9f-a8f0-9264e48ef899] [56e93ef5-dd95-4743-99d7-873b6132655d] [INF] Request starting HTTP/1.1 GET http://localhost:8800/health/live - null null (Microsoft.AspNetCore.Hosting.Diagnostics)
[11:19:20] [7b88516f-aa4b-4e9f-a8f0-9264e48ef899] [56e93ef5-dd95-4743-99d7-873b6132655d] [INF] Executing endpoint 'Health checks' (Microsoft.AspNetCore.Routing.EndpointMiddleware)
[11:19:20] [7b88516f-aa4b-4e9f-a8f0-9264e48ef899] [56e93ef5-dd95-4743-99d7-873b6132655d] [INF] Executed endpoint 'Health checks' (Microsoft.AspNetCore.Routing.EndpointMiddleware)
[11:19:20] [7b88516f-aa4b-4e9f-a8f0-9264e48ef899] [56e93ef5-dd95-4743-99d7-873b6132655d] [INF] HTTP GET /health/live responded 200 in 776.3736 ms (Serilog.AspNetCore.RequestLoggingMiddleware)
[11:19:20] [7b88516f-aa4b-4e9f-a8f0-9264e48ef899] [56e93ef5-dd95-4743-99d7-873b6132655d] [INF] Request finished HTTP/1.1 GET http://localhost:8800/health/live - 200 null application/json 779.5505ms (Microsoft.AspNetCore.Hosting.Diagnostics)
When I have the Filter as below and what is does is commented above on each filter
"Filter": [
{
"Name": "ByExcluding",
"Args": {
// I could see no logs at all
//"expression": "RequestPath like '/health/%' and not (@Message like '%Request finished%')"
// on the below ones I see the last log of Request Finished is exlcuded and rest are logged
//"expression": "RequestPath like '/health/%' and StatusCode = 200"
//"expression": "RequestPath like '/health/%' and StatusCode = 200 and @Message not like '%Request finished%'"
}
}
],
When I have the Filter as below and what is does is commented above on each filter
"Filter": [
{
"Name": "ByExcluding",
"Args": {
// I could see no logs at all
//"expression": "RequestPath like '/health/%' and not (@Message like '%Request finished%')"
// on the below ones I see the last log of Request Finished is exlcuded and rest are logged
//"expression": "RequestPath like '/health/%' and StatusCode = 200"
//"expression": "RequestPath like '/health/%' and StatusCode = 200 and @Message not like '%Request finished%'"
}
}
],
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745309329a4621907.html
评论列表(0条)