Friday, January 22, 2016

GWT Client Side logging

GWT is special kind of web development technogies where we are broadly classifying development in two part
1- Client side :- Getting compiled in Java Script
2- Server side :- Getting compiled in class files

Server side logging can be done by using log4j

But in terms of GWT their are many different ways to debug client side. One of them is to use the class of GWT.

To do client side logging using this class following changes need to be done

Step 1- Add following line in you *.gwt.xml

Step -2 Add following line in your Client side code

private static Logger rootLogger = Logger.getLogger(YourClientClass.class.toString());
rootLogger.log(Level.SEVERE, "Shwing client side loggin on the user Browser screen");

When you execute the same on browser you will be able to see above log in pop as shown below.

No comments: