Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loggers in GWT Client Side

Tags:

logging

gwt

Is there a way to report log messages in a Client-side GWT applications for development purposes (in Standard GWT libraries i.e. No external libraries)?

i.e. like the Logger that can be used to output log messages to catalina.out when developing things for say Tomcat.

like image 608
Federer Avatar asked Jan 22 '10 14:01

Federer


2 Answers

Take a look to the gwt-log project. Seems that's you're looking for.

http://code.google.com/p/gwt-log/

like image 58
Carlos Tasada Avatar answered Nov 19 '22 08:11

Carlos Tasada


Just a quick example..

Add this line in *.gwt.xml file. Its in parent package of your client side source. The top most package..

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

Add this in .java file, lets say in the onModuleLoad() method

public void onModuleLoad() {
  Logger logger = Logger.getLogger("NameOfYourLogger");
    logger.log(Level.SEVERE, "this message should get logged");
like image 37
Vincent Vettukal Avatar answered Nov 19 '22 09:11

Vincent Vettukal