Mark,
On 8/19/25 3:01 AM, Mark Thomas wrote:
All,
I stumbled across quite few instances of log messages like this while I
was looking at something for $dayjob:
log.error(sm.getString("naming.bindFailed", e));
It would be lot more useful with the stack trace so I think that really
should be:
log.error(sm.getString("naming.bindFailed"), e);
I had to read that 3 or 4 times to see that the ) had moved.
+1 for this change. If there is an exception being logged, I'm 100% in
favor of logging a stack trace. Most logging frameworks can be
configured to log stack traces or not. But they can't log (or not) if
the exception itself is not present.
Unless there are objections, I am going to change any log message with a
level of warning or greater that currently includes e, e.toString(),
e.getMessage() etc in the log message and doesn't log the full stack
trace to log the stack trace. I'll likely remove the exception from the
log message as well to avoid duplicating the text in the logs.
INFO level and is a little different. Those need looking at on a case by
case basis as I can imagine there are some cases where logging the full
stack trace is not necessary.
+1
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org