我正在尝试在我的 gwt 应用程序上使用 gwt-log 但我无法从该库中获取任何日志消息(我不知道应该在哪里找到它们)我已将这些配置添加到我的 gwt.xml文件
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
<extend-property name="log_level" values="DEBUG"/>
<set-property name="log_level" value="DEBUG"/>
<set-property name="log_DivLogger" value="DISABLED" />
并且我修改了我的入口点类如下:
public void onModuleLoad() {
Log.setUncaughtExceptionHandler();
DeferredCommand.addCommand(new Command() {
public void execute() {
onModuleLoad2();
}
});
}
private void onModuleLoad2() {
if (!Log.isLoggingEnabled()) {
Window.alert("Logging is disabled. No log messages will appears.");
}
Log.trace("This is a 'TRACE' test message");
Log.debug("This is a 'DEBUG' test message");
Log.info("This is a 'INFO' test message");
Log.warn("This is a 'WARN' test message");
Log.error("This is a 'ERROR' test message");
Log.fatal("This is a 'FATAL' test message");
}
我可以在控制台上打印这些消息,但问题是我无法在服务器端或客户端打印任何其他消息,所以我是否遗漏了什么?
谢谢
最佳答案
您应该能够在托管模式下的开发控制台(Jetty 容器包装)中看到它们。您可以找到所有 HTTP 流量的日志 + 特定“主机”的 gwt 日志。
我不确定如何将它们转发到生产模式的外部目的地,尽管您应该可以。
关于java - gwt-log 日志消息在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4736895/