GWT.log logs not showing in the GWT Dev Mode console

青春壹個敷衍的年華 提交于 2020-01-03 19:04:40

问题


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?


回答1:


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...



来源:https://stackoverflow.com/questions/17463928/gwt-log-logs-not-showing-in-the-gwt-dev-mode-console

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!