Skip to content

Commit

Permalink
Improve DataAccess logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gumbarros committed Jan 7, 2025
1 parent 2c6da9f commit 9ea55e4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Commons/Logging/BatchingLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
message.AppendLine("StackTrace:");
message.AppendLine(exception.StackTrace);
}

if (exception.Data.Contains("DataAccess Query"))
{
message.AppendLine("DataAccess Query:");
message.AppendLine(exception.Data["DataAccess Query"].ToString());
}
if (exception.Data.Contains("DataAccess Parameters"))
{
message.AppendLine("DataAccess Parameters:");
message.AppendLine(exception.Data["DataAccess Parameters"].ToString());
}
}
loggerProvider.AddMessage(new LogMessage
{
Expand Down

0 comments on commit 9ea55e4

Please sign in to comment.