My question is: is it better to register with getMessage or with toString or both? taking into account open source bugs. I saw the questions in the comments, but did not receive an answer to this. Maybe I missed something? Do not pay attention to the small success associated with recording one of them, but do not want to register both if there is no good reason.
The value of log (ex) or log (ex.getMessage), not to mention the stack trace.
Saw 1 , 2 and 3
Log exceptions: which is better: log.warn (ex.getMessage (), ex) or log.warn (ex, ex);
I noticed that sometimes getMessage returns a null or zero value, so in normal practice there is some reason not to use:
log.warn(ex, ex);
Does it seem to print the class name and message (if set)? I suppose one of the reasons might be that the subclass class is overloaded so as not to print the message, but are any of the hibernate, apache or spring libs actually doing?
source share