nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

ADOExceptionReporter logs errors without a stack trace

Open justaszal opened this issue 1 year ago • 1 comments

Hello,

The ADOExceptionReporter does not include the stack trace for error logs, only warnings. The problem is that our application is configured to not log warnings for NHibernate, and we cannot see the stack trace of the error logs in our observability system.

https://github.com/nhibernate/nhibernate-core/blob/ebdbb6ebbdd9c47dff1926678f4d9a519d6da8f0/src/NHibernate/Util/ADOExceptionReporter.cs#L29-L34

We propose to log errors like this: log.Error(ex, ex.Message).

justaszal avatar Jul 09 '24 06:07 justaszal

As part of adjusting the Error log, wouldn't it also make sense to remove the Warning log to avoid duplicate logging here?

wurtzthomas avatar Nov 11 '25 11:11 wurtzthomas