stuff
This commit is contained in:
parent
14fd359ea8
commit
a4ef2b4a20
26 changed files with 331 additions and 78 deletions
37
Femto.Common/Logs/LoggerExtensions.cs
Normal file
37
Femto.Common/Logs/LoggerExtensions.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Femto.Common.Logs;
|
||||
|
||||
public static partial class LoggerExtensions
|
||||
{
|
||||
[LoggerMessage(
|
||||
LogLevel.Error,
|
||||
EventId = 1,
|
||||
EventName = "FailedRequestWithException",
|
||||
Message = "Request failed: {Method} {Path}, Status: {StatusCode}, TraceId: {TraceId}, Message: {Message}"
|
||||
)]
|
||||
public static partial void LogFailedRequest(
|
||||
this ILogger logger,
|
||||
Exception exception,
|
||||
string method,
|
||||
string path,
|
||||
int statusCode,
|
||||
string traceId,
|
||||
string message
|
||||
);
|
||||
|
||||
[LoggerMessage(
|
||||
LogLevel.Error,
|
||||
EventId = 2,
|
||||
EventName = "FailedRequest",
|
||||
Message = "Request failed: {Method} {Path}, Status: {StatusCode}, TraceId: {TraceId}, Message: {Message}"
|
||||
)]
|
||||
public static partial void LogFailedRequest(
|
||||
this ILogger logger,
|
||||
string method,
|
||||
string path,
|
||||
int statusCode,
|
||||
string traceId,
|
||||
string message
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue