首先我的web.xml文件
<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>
所有,請確保使用附加參數-deploy war/WEB-INF/deploy /編譯您的GWT應用程序。
其次,請確保符號圖存在於目錄 WEB-INF/deploy/detectfiles/symbolMaps/
中。我觀察到符號映射在我編譯時轉到目錄WEB-INF/deploy/<module-name>/symbolMaps/
。在這裏,detectfiles
看起來不像你的模塊名稱。因爲在url-pattern中,您已指定com.renault.detectfiles
作爲模塊名稱。
這些可能是未看到日誌的可能原因。
嗨,是的,我的模塊名稱detectfiles。所以在我的url模式中,我將其更改爲/ detectfiles/gwt-log。符號映射確實存在於指定的目錄中。但仍然沒有生成日誌:( – Madhura
)不知道是什麼問題,你可以做一件事情來檢查服務器端的配置是否正確,把調試日誌放到你的servlet中,並檢查它是否正常工作 –
debug log works很奇怪,沒有與gwt日誌相關的錯誤或異常......我確信在某個地方我錯過了一些次要的東西......如果你以前使用過gwt-logs,你可以在這裏粘貼一個例子我將比較和驗證? – Madhura