1
votes

Using gwt logs jar I am able to display logs on my console. But now I wanted to add logs in my olgs file from cient side, as we do using log4j on server side. So i reffered to http://code.google.com/p/gwt-log/wiki/GettingStarted this link but i dont see any client side logs getting generated in my log file.

Following is my gwt.xml file

<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
<set-property name="log_DivLogger" value="DISABLED" />
<!-- In gwt-log-3.0.3 or later -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-RemoteLogger" />
<set-configuration-property name="log_pattern" value="%d [%t] %p - %m
   %n" />

Following is my web.xml file

<servlet>
<servlet-name>gwt-log-remote-logger-servlet</servlet-name>
<servlet-class>com.allen_sauer.gwt.log.server.RemoteLoggerServiceImpl</servlet-class>
<!--
   The `symbolMaps` parameter specifies the server directory
    containing the GWT compiler symbol maps output, which is used
     for stack trace deobfuscation
    -->
  <init-param>
       <!-- This value assumes a GWT compile with '-deploy war/WEB-INF/deploy/' -->
      <param-name>symbolMaps</param-name>
       <!--
     Modify the param-value based on your server environment. Some web servers
    use your `war` directory as the 'current working dir', while other
    vendors will do something different. You may use trial and error. Specify the
    relative path you think should work, then check the server log after forwarding
    the first client log message to the server. If the directory cannot be found,
    gwt-log will report the full path which it tried.
  -->
  <param-value>WEB-INF/deploy/detectfiles/symbolMaps/</param-value>
  </init-param>

  <!--
    Additional or alternate directories may be specified via additional parameter
  which also begin with `symbolMaps`. This may be useful if you deploy to multiple
  server environments which use different directory structures or have a different
  notion of what the 'current working directory' is.
 --> 
 <init-param>
   <param-name>symbolMaps_2</param-name>
   <param-value>WEB-INF/deploy/detectfiles/symbolMaps/</param-value>
 </init-param>

     <!-- Optionally enable CORS (http://www.w3.org/TR/cors/)
  <init-param>
     <param-name>Access-Control-Allow-Origin</param-name>
     <param-value>http://your-applications-origin</param-value>
  </init-param> 
  -->
</servlet>

<servlet-mapping>
    <servlet-name>gwt-log-remote-logger-servlet</servlet-name>
  <url-pattern>/com.renault.detectfiles/gwt-log</url-pattern>
  </servlet-mapping>

I have added log on clinet side as follows

        Log.debug("Hi this is a debug log");
1

1 Answers

0
votes

First of all, make sure that you compile your GWT application with the additional parameter -deploy war/WEB-INF/deploy/.

Second, make sure that symbol maps exist in the directory WEB-INF/deploy/detectfiles/symbolMaps/. I observed that symbolMaps go to the directory WEB-INF/deploy/<module-name>/symbolMaps/ when I compiled. Here, detectfiles does not look like your module name. Because, in the url-pattern, you have specified com.renault.detectfiles as the module name.

These might be the possible cause of not seeing the log.