in the process of WEB development, for example, when a runtime exception occurs in the Dao layer, the exception information can be captured and printed in the WEB exception handler. However, when requesting to which Dao layer, it is assumed that there are corresponding DEBUG logs in each method. If you can better and gracefully allow the exception, record all the DEBUG logs before the exception, instead of just recording the context information of the current exception method. But the DEBUG information of the entire request call chain is also printed?
find a similar question in CSDN, but to get an answer.
how can I print out the above debug log when an exception occurs?