Setup a remoteLoggingServlet in GWT

前端 未结 2 961
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 03:05

From http://code.google.com/intl/es-ES/webtoolkit/doc/latest/DevGuideLogging.html under the remote logging section it says that you need to

You will

相关标签:
2条回答
  • 2020-12-29 03:42

    I found this blog post very helpful:

    https://vegdave.wordpress.com/2013/02/26/howto-setup-gwt-remote-logging/

    App.gwt.xml:

    <inherits name=”com.google.gwt.logging.Logging”/>
    <set-property name=”gwt.logging.simpleRemoteHandler” value=”ENABLED” />
    <set-property name=”gwt.logging.logLevel” value=”FINEST”/>
    <set-property name=”gwt.logging.enabled” value=”TRUE”/>
    <set-property name=”gwt.logging.consoleHandler” value=”ENABLED” />
    <set-property name=”gwt.logging.popupHandler” value=”DISABLED” />
    

    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>/YOUR_MODULE/remote_logging</url-pattern>
    </servlet-mapping>
    

    In GWT:

    import com.google.gwt.logging.client.SimpleRemoteLogHandler;
    import java.util.logging.Level;
    import java.util.logging.LogRecord;
    
    SimpleRemoteLogHandler remoteLog = new SimpleRemoteLogHandler();
    remoteLog.publish(new LogRecord(Level.INFO, “log message”));
    
    0 讨论(0)
  • 2020-12-29 03:46

    You should define remote_logging servlet in your web.xml:

    <!-- remote logging -->
    <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>/your-gwt-module-name/remote_logging</url-pattern>
    </servlet-mapping>
    
    0 讨论(0)
提交回复
热议问题