0

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
Jean-Michel Garcia
  • 2,359
  • 2
  • 23
  • 44
  • Did you configure `java.util.logging`? http://docs.oracle.com/javase/7/docs/technotes/guides/logging/overview.html & http://docs.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html – Thomas Broyer Sep 06 '12 at 11:04
  • No, let me take a look at your link – Jean-Michel Garcia Sep 06 '12 at 11:23
  • @ThomasBroyer where should the logging.properties files be ? Is there any other configuration needed ? – Jean-Michel Garcia Sep 06 '12 at 12:19
  • @ThomasBroyer Reading GWT docs, I've see this : *Unlike java.util.logging, GWT logging is configured using .gwt.xml files*. So, I don't understand why I need to have a `logging.properties` file – Jean-Michel Garcia Sep 06 '12 at 12:37
  • 1
    Ah sorry, no idea. I actually never used java.util.logging, even less trying to make it output something during tests. I suppose you could pass the path to the file (e.g. `src/test/logging.properties`) with the `java.util.logging.config.file` system property (via `extraJvmArgs` of the `gwt:test` mojo) – Thomas Broyer Sep 06 '12 at 12:37

1 Answers1

0

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.

Jean-Michel Garcia
  • 2,359
  • 2
  • 23
  • 44