I have a GWT application which is run with maven:
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...