First, I would say that using this setting in the logging.properties file:
.level = WARNING
And you ( do not specify any level when entering your code, the default level will be used, which, of course, is not a "WARNING" (I would suggest INFO ^^) do specify the level of logging using this line:
log.info(msg); log.log(Level.INFO, msg);
So the result is that you only register at the "INFO" level (in your example), but your configuration file says to register at WARNING and above. Because the “information” level is below the “warning”, they are discarded from your log file and not displayed in your server’s log.
I suggest trying this method instead, which forces you to specify the level of logging.
import java.util.logging.Level; import java.util.logging.Logger; log.log(Level.INFO, "a info msg");
After that, you can use the logging.properties file to set the logging levels that you want for the classes you need:
# Set the default logging level for all loggers to WARNING .level = WARNING
Edit2: This registration configuration does not affect client-side operation. When you want to register a message in GWT, there is this GWT.log(message); but no level can be specified.
This is not entirely correct, it depends on the configuration in your-app.gwt.xml . All details can be found in google dev guilde logging . I found this very useful and well done. However, in the walnut shell in GWT there are different default loggers (about 5-6); they are all configured in *.gwt.xml through their handlers (or can be done pragmatically). After you had an invasive pop-up registrar, I decided to remotely register it from server to server in order to use logging.properties , here is the configuration when using gwt.xml :
<inherits name="com.google.gwt.logging.Logging"/> <set-property name="gwt.logging.logLevel" value="INFO"/> <set-property name="gwt.logging.enabled" value="TRUE"/> <set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" /> <set-property name="gwt.logging.popupHandler" value="DISABLED" /> <set-property name="gwt.logging.developmentModeHandler" value="ENABLED" /> <set-property name="gwt.logging.systemHandler" value="ENABLED" /> <set-property name="gwt.logging.firebugHandler" value="DISABLED" /> <set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
If you use this setting, be sure to configure web.xml using the servlet definition for logging (this is not indicated in the documentation, unfortunately):
<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-app-name/remote_logging</url-pattern> </servlet-mapping>
Good luck