[英]Log4j is not catching exceptions
I am using google app engine and I am having trouble with log4j.我正在使用谷歌应用引擎,但在使用 log4j 时遇到了问题。 Basically I am testing my app and the exceptions are being detected by the dashboard, but not log4j.
基本上我正在测试我的应用程序并且仪表板检测到异常,但不是 log4j。 I am using the following:
我正在使用以下内容:
catch (Exception e) {
logger.warn("Exception Alert", e);
e.printStackTrace();
}
Is this the correct way to catch exceptions using Log4j?这是使用 Log4j 捕获异常的正确方法吗? It works for some exceptions now.
它现在适用于一些例外情况。 But not all.
但不是所有的。 I want to catch a NumberFormatException (empty string) but this is isn't working.
我想捕获一个 NumberFormatException(空字符串),但这不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.