使用log4j进行GWT远程日志记录

时间:2014-07-16 10:31:09

标签: java spring gwt logging

我想将GWT客户端日志记录到服务器中存在的日志文件中(我的应用程序基于GWT-Springs)。

我做了以下更改:

1)在gwt.xml文件中包含以下行

a)<inherits name="com.google.gwt.logging.Logging"/> 
b)<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED"/>

2)在GWT java文件中,我有以下代码

import java.util.logging.Logger;
  private static Logger logger = Logger.getLogger("myClassName");
  logger.info("log the message");

3)在web.xml中,我已经定义了servlet如下

<servlet>    
<servlet-name>remoteLoggingServlet</servlet-name>    
<servlet-class>com.google.gwt.logging.server.RemoteLoggingServiceImpl</servlet-class>  
</servlet>  

<servlet-mapping>    
  <servlet-name>remoteLoggingServlet</servlet-name>    
  <url-pattern>/module_name/remote_logging</url-pattern>  
</servlet-mapping>

4)在Spring中我有log4j配置,它将service / dao层中的所有日志记录到日志文件中。

但是我无法将GWT日志打印到服务器

中的日志文件

1)有人可以帮助解决这个问题吗?

2)此外,我无法理解GWT日志流向服务器中的日志文件?

3)<url-pattern>/module_name/remote_logging</url-pattern>

的意义是什么?

4)在模式名称/ URL模式

之后应该出现什么

5)/ remote_logging是否映射到其他地方?

0 个答案:

没有答案