diff --git a/src/Commons/Logging/BatchingLogger.cs b/src/Commons/Logging/BatchingLogger.cs index b2d63d52a..0e5a3d48c 100644 --- a/src/Commons/Logging/BatchingLogger.cs +++ b/src/Commons/Logging/BatchingLogger.cs @@ -39,6 +39,17 @@ public void Log(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 {