Please ask if you can save the error stack information that occurs when the program is running into the log file specified by log4j.
For example, a run-time error occurs while the program is running, and the following error stack information is printed in the console window:
Exception in thread "main" java.lang.ArithmeticException:/By zero
At Des.main (des.java:43)
I specify the log output level to debug in the log4j configuration file, and the run-time error log that appears when the program is running can only be displayed in the console window, and there is no way to output them to the log file specified log4j. (now the log file can only get logs such as Log.debug (), Log.error () and other output, but not the run-time error stack log)
I know through things like:
try{ ... } catch (Exception e) { Log.debug (e); } Way, but this is too much trouble, it is impossible to write such statements in all the code, there is no easy way.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.