Search code examples
gwtmavenmaven-3gwt-maven-plugin

GWT client side logging during maven test phase


I'm writing a GWT library and I'm trying to use GWT's Logging capabilities.

My maven build trigger some GWTTestCases that tests my library.

Is it possible to have and configure the logging output of my library ? So that I could see the logging during the test phase.

What I actually have, but it is not working :

The .gwt.xml file :

<inherits name="com.google.gwt.logging.Logging"/>
<set-property name="gwt.logging.enabled" value="TRUE"/>
<set-property name="gwt.logging.logLevel" value="ALL"/>
<set-property name="gwt.logging.systemHandler" value="ENABLED"/>
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED"/>
<set-property name="gwt.logging.consoleHandler" value="ENABLED"/>

In java code :

private final static Logger logger = Logger.getLogger("xxx.client.Fusion");

...

logger.info("Test");
logger.finer("Test");

I also tried setting the logLevel of the gwt-maven-plugin.

What am I missing ?

EDIT

I'm putting a logging.properties file under src/main/webapp/WEB-INF. For testing, this file only contains :

.level = ALL

Solution

  • I didn't achieve such thing.

    When I try to pass to path to logging.properties files using -Djava.util.logging.config.file I get a error from GWTTestCase.

    So, IMHO, this is not a good usage for logging in general. Therefore, this kind of usage is not recommended.

    For people obstinated to do it, I should recommend to take a look at gwt-log.