This article is a mirror article of machine translation, please click here to jump to the original article.

View: 29500|Reply: 3

[Source] Java gets full exception information (call stack)

[Copy link]
Posted on 9/18/2021 11:15:22 AM | | | |
Exceptions using e.toString() or e.getMessage() to obtain exception information are generally incomplete, so use e.printStackTrace(). Able to output a full error message, but the method is static.

Because I need to submit the exception log and push it to the log collection center, how can I get the completed exception information?

solution







Previous:Ask how C# parses JceStruct-ProtoBuf
Next:Windows uses cwRsync (Rsync) to synchronize two disk files
Posted on 9/23/2021 9:14:56 AM |
Comments from human high-quality coders
 Landlord| Posted on 9/24/2021 10:58:16 AM |
ch.qos.logback error

After inheriting the RollingFileAppender class, get the exception information by rewriting the subAppend:


 Landlord| Posted on 2/24/2022 5:06:03 PM |
The complete exception is converted into a string, copied from the source code of ch.qos.logback.classic.pattern.ThrowableProxyConverter, and the code is as follows:

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com