nhibernate-core
nhibernate-core copied to clipboard
ADOExceptionReporter logs errors without a stack trace
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).
As part of adjusting the Error log, wouldn't it also make sense to remove the Warning log to avoid duplicate logging here?