【问题标题】:Need more information when exceptions are thrown using Log.setUncaughtExceptionHandler使用 Log.setUncaughtExceptionHandler 引发异常时需要更多信息
【发布时间】:2011-03-31 19:46:02
【问题描述】:

我目前在 GWT 和 GAE 中使用 gwt-logs。我有我的模块 按照入门中的说明进行配置:

<inherits name="com.allen_sauer.gwt.log.gwt-log-OFF" />
<inherits name="com.allen_sauer.gwt.log.gwt-log-RemoteLogger" />
<extend-property name="log_level" values="DEBUG" />

我有我的入口点类:

Log.setUncaughtExceptionHandler()

问题是当我在客户端收到未捕获的异常时,我只 进入我的 GAE 日志是: “com.allen_sauer.gwt.log.server.ServerLogImplJDK14 日志:未捕获 例外:” 我想包含有关异常来源的更多信息(例如: 类名、参数、错误类型、异常堆栈跟踪)。我如何能 配置执行此操作?

非常感谢。

【问题讨论】:

    标签: google-app-engine gwt


    【解决方案1】:

    看我看到的源码

      public final void setUncaughtExceptionHandler() {
        GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
          public void onUncaughtException(Throwable e) {
            Log.fatal("Uncaught Exception:", e);
          }
        });
        setErrorHandler();
      }
    

    所以看起来您要么需要扩展类,要么再次设置未捕获的异常处理程序。

    【讨论】:

    • 这没有被标记为答案,但肯定对我有用。谢谢大地!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-30
    • 1970-01-01
    • 2011-12-04
    • 2018-06-06
    • 1970-01-01
    相关资源
    最近更新 更多