GWT.log日志未显示在GWT Dev Mode控制台中 [英] GWT.log logs not showing in the GWT Dev Mode console

查看:322
本文介绍了GWT.log日志未显示在GWT Dev Mode控制台中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用maven运行的GWT应用程序:

  mvn gwt:run 
GWT.log
日志都没有显示出可能是什么问题?

解决方案

为了使日志工作起作用,您需要具备以下功能:



记录模块在您的模块xml文件中继承:

 < inherits name =com.google.gwt .logging.Logging/> 

记录 level set and handlers configured:

 < set-property name =gwt.logging.logLevelvalue =FINE/> 
< set-property name =gwt.logging.developmentModeHandlervalue =ENABLED/>
< set-property name =gwt.logging.firebugHandlervalue =DISABLED/>
< set-property name =gwt.logging.simpleRemoteHandlervalue =DISABLED/>

您可能需要一个不同的处理程序配置,而不是基于您要实现的处理程序配置, info检查官方文档



请注意,我设置的级别为 FINE ,这将确保您记录的大部分内容不会被任何处理程序忽略,因为FINE是最低级别之一。默认情况下,日志记录器被配置为只处理 SEVERE 级别的日志,通常会忽略剩下的日志,而SEVERE是最高级别的日志。下一步,您需要确保您用于记录的级别包含在您在XML模块文件中设置的LEVEL中。例如,如果您使用...

  static final Logger logger = Logger.getLogger(MyClass.class.getName()); 
logger.fine( - MESSAGE--);
//或
logger.log(Level.FINE,--MESSAGE--);

...此级别必须设置为FINE或其他任何级别,你的日志,如果你选择高于FINE的任何级别,所有这些消息将被忽略。



希望这有助于......


I have a GWT application which is run with maven:

mvn gwt:run

However, all the GWT.log logs are not being showed what could be the problem?

解决方案

In order for the logging to work you need to have the following:

Logging module inherited in your module xml file:

<inherits name="com.google.gwt.logging.Logging" />

Logging level set and handlers configured:

<set-property name="gwt.logging.logLevel" value="FINE" />
<set-property name="gwt.logging.systemHandler" value="ENABLED" />
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED" />
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
<set-property name="gwt.logging.firebugHandler" value="DISABLED" />
<set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED" />

You may need a different handler configuration than this one based on what you are tring to achieve, for more info check the offical doc on that matter.

Notice that the level I set up is FINE which would ensure that most of what you log is not ignored by any handler since FINE is one of the lowest levels. By default loggers are configured to handle only SEVERE level logs, which usually ignores the rest, SEVERE being the highest level.

Next you need to ensure that the level you use to log is included withing the LEVEL you setup on the XML module file. For instance if you use...

static final Logger logger= Logger.getLogger(MyClass.class.getName());
logger.fine("--MESSAGE--");
// or     
logger.log(Level.FINE, "--MESSAGE--");

...the level must be set to FINE or any other level below for this messages you appear in your log, if you choose any level above FINE, all those messages will be ignored.

Hope this helps...

这篇关于GWT.log日志未显示在GWT Dev Mode控制台中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆