Suppose that I have a legacy java application with thousands of lines of code which do:
try {
// stuff
} catch (Exception e) {
// eat the exception
}
Is there any global option that I could flip or 3rd party JAR which would log all "eaten" exceptions? I know that I could do a massive find replace (search for catch (Exception e) { and replace it with catch(Exception e) { logException(e);) but I was wondering if there was a better solution. Thanks!
You could perhaps provide your own implementation of Exception
which logs the stack-trace in the constructor. From the man page of java:
-Xbootclasspath:bootclasspath
Specify a colon-separated list of directories, JAR archives, and ZIP archives to search for boot class files. These are used in place of the boot class files included in the Java 2 SDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With