GWT 2.7 Logging Is Not Working

白昼怎懂夜的黑 提交于 2020-01-15 07:37:06

问题


I created the sample GWT app in IntelliJ 14 using GWT 2.7 and Java 7. I started Super Dev Mode, but the log statment at the start of onModuleLoad is not printing to the Javascript console. I create a similar example project using GWT 2.5.1 and I was able to get the logging to print using the same logging configuration as described below.

CodeServer Startup Message

Runing CodeServer with parameters: [-noprecompile, -port, 9876, -sourceLevel, 1.7, -bindAddress, 127.0.0.1, -launcherDir, /Users/xxx/Library/Caches/IntelliJIdea14/gwt/gwt5.10e7b474/gwt5.bbec8ec6/run/www, -logLevel, INFO, com.mySampleApplication.MySampleApplication]

MySampleApplicaton.gwt.xml

<module rename-to="MySampleApplication">

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

<source path='client' />
<source path='shared' />

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>

<!-- Specify the app entry point class. -->
<entry-point class='com.mySampleApplication.client.MySampleApplication'/>


<!-- Specify the app servlets. -->
<servlet path='/MySampleApplicationService' class='com.mySampleApplication.server.MySampleApplicationServiceImpl'/>

</module>

MySampleApplication.java (EntryPoint)

public class MySampleApplication implements EntryPoint {

private static final Logger logger = Logger.getLogger(MySampleApplication.class.getName());

  public void onModuleLoad() {
      logger.log(Level.INFO, "Starting module gwt5");
      ...
  }

}

回答1:


Have you tried to add:

<set-property name="gwt.logging.enabled" value="TRUE"/>

to your module descriptor? This works for me.

Hope that helps.



来源:https://stackoverflow.com/questions/28402833/gwt-2-7-logging-is-not-working

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