where are gwt-log log messages?
I'm trying to use gwt-log on my gwt application but I can't get any log message from this library( I don't know where should I found them) I have added these configura开发者_如何学Gotion to my gwt.xml file
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
<extend-property name="log_level" values="DEBUG"/>
<set-property name="log_level" value="DEBUG"/>
<set-property name="log_DivLogger" value="DISABLED" />
and I have modified my entry point class as follows:
public void onModuleLoad() {
Log.setUncaughtExceptionHandler();
DeferredCommand.addCommand(new Command() {
public void execute() {
onModuleLoad2();
}
});
}
private void onModuleLoad2() {
if (!Log.isLoggingEnabled()) {
Window.alert("Logging is disabled. No log messages will appears.");
}
Log.trace("This is a 'TRACE' test message");
Log.debug("This is a 'DEBUG' test message");
Log.info("This is a 'INFO' test message");
Log.warn("This is a 'WARN' test message");
Log.error("This is a 'ERROR' test message");
Log.fatal("This is a 'FATAL' test message");
}
and I can get these messages printed on console but the problem is that I can't get any other message printed either in server side or in client side,So is there something I'm missing?
Thanks
You should be able to see them in the development console (Jetty container wrap), in hosted mode. You can find a log of all HTTP traffic + gwt logs for a specific "host".
I'm not exactly sure how you can forward them to write to an external destination for production mode, though you should be able.
Make sure you setup the required servlet in web.xml.
As a side note, if you are using GWT 2.1 or higher, you can start using the new Logging framework, which emulates Java's built-in logging framework.
精彩评论