newbie question about server side logging

32 views
Skip to first unread message

Ken C

unread,
Sep 8, 2013, 5:48:39 PM9/8/13
to gwt...@googlegroups.com
I am new to GWT, and I haven't been able to get logging working on the server side. I installed gwt-log per the instructions and get the divLogger in my DOM. But when I do com.allen_sauer.gwt.log.client.Log.debug("Hello World") in my servlet class, nothing shows up in the divLogger. This is all under Eclipse, using Chrome and the Chrome debug plugin. GWT.log() doesn't work on the server side either, which is what made be find gwt-log in the hopes it might help.

I am pretty sure I am doing something fundamentally wrong. Any ideas? I have poured over the "have you remembered to..." usual suspects a hundred times. I get no errors, just chirping crickets.

TIA,
Ken

Shawn Johnson

unread,
Nov 13, 2013, 7:06:50 PM11/13/13
to gwt...@googlegroups.com
Ken, gwt-log is only intended for logging on the client-side, same for GWT.log().  Basically if something bad (or good) happens in the browser, it will send a message back to your server.  Your application server should be configured for logging with log4j or other logging package.  So, on your server you might have server.log - this is where you might get the remote log messages.

In your servlet classes,  you would simply instantiate an instance of a logger, such as log4j.  Something like:
Logger log = Logger.getLogger(MyClass.class);
Reply all
Reply to author
Forward
0 new messages