I’m using GWT-log in order to write log messages. for now, I can see the logs in console and in a catalina file (in my tomcat) I want to write the logs to specific file (which I will define). How can I do that?
I am using GWT romote-logging:
<inherits name="com.google.gwt.logging.Logging"/>
<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
in My web.xml:
<servlet>
<servlet-name>remoteLogging</servlet-name>
<servlet-class>com.google.gwt.logging.server.RemoteLoggingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>remoteLogging</servlet-name>
<url-pattern>/MyModule/remote_logging</url-pattern>
</servlet-mapping>
I have tried configuring logging.properties to write to a file, but haven’t had any luck.
Also tried configuring at the root of my project as well without success.
I am wondering if this is because java.util.logging.FileHandler is not among the emulated classes?
http://code.google.com/intl/es-ES/webtoolkit/doc/latest/DevGuideLogging.html#Emulated_And_Non_Emulated
This would be a shame to be able to get so close but not be able to track these types of errors in production.
That doesn’t make sense to me, however, since under the covers the remote logging service appears to just use vanilla java.util.Logging:
http://www.google.com/codesearch#A1edwVHBClQ/user/src/com/google/gwt/logging/server/RemoteLoggingServiceUtil.java&is_navigation=1
———Update————
For what it’s worth, I ended up taking the RemoteLoggingServiceUtil and RemoteLoggingServiceImpl classes and implementing them myself, and swapping them to use log4j instead.
This resolved the issue completely and I can now configure this to log to a server side log.
This may be specific to GWT logging, or it may be my lack of experience configuring java.util.Logging, but this ended up being much cleaner since I use log4j everywhere else in the project anyway, so I can have a single log file.
All this required was changing the web.config remote logging servlet to point to my own file: