Details
-
New Feature
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
Description
I have seen many examples where developers want to dump a stack trace to the log system simply to track the execution path of the Thread and not associated with any real issue.
LOG.trace("Stack Trace Dump", new Exception());
The output is something like:
2019-11-19T08:13:31,392 TRACE [Logger] Class: Stack Trace Dump java.lang.Exception: null at ...
I would like to propose that SLF4J ships with an Exception class specific to this scenario. A user could easily mistake this as logging as being related to a real error condition instead of its intended informational purpose because it has the word 'Exception' in it and may be interpreted as being related to an erroneous 'null' value.
LOG.trace("Stack Trace Dump", new StackTraceDump()); 2019-11-19T08:13:31,392 TRACE [Logger] Class: Stack Trace Dump ch.qos.slf4f.StackTraceDump: Dumping stack trace at ...