At the moment, client-side logging works only when debugging GWT application via Development Mode [1]: import java.util.logging.Logger; // GWT emulates java.util.logging classes static final Logger logger = Logger.getLogger(Anything.class.getName()); logger.info("Example log entry"); [1] http://www.ovirt.org/DebugFrontend#GWT_Development_Mode When compiling GWT application for production use, GWT compiler removes such client-side logging statements from resulting JavaScript code. Compared to Development Mode, GWT application compiled for production use has following inconveniences: a, client-side logs are not available b, runtime errors are silently ignored [2] - user has to open browser-specific error console to inspect any runtime errors [2] currently there is no global error handler to catch runtime errors, which means GUI can be broken whenever uncaught exception escapes from application code (severity of GUI breakage depends on place where exception occured and code that was meant to normally execute after it) This RFE targets above mentioned inconveniences: a, provide support for persisting client-side logs locally in the browser, utilizing existing ClientStorage abstraction b, add global error handler that persists uncaught exceptions and prevents them from escaping application code In future, we can consider follow-up improvements (out of scope for this BZ, unless we decide otherwise): * modify java.util.logging emulation to utilize persistent client-side logging support * implement "Show Errors" GUI dialog to visualize collected runtime errors * propagate collected runtime errors to server (engine-ui.log) References: http://stackoverflow.com/questions/3028521/gwt-setuncaughtexceptionhandler
Update of BZ description (comment #0): - client-side logging code is retained also in production (non-debug) GWT application builds - patch [1] ensures that client-side log records are persisted in browser via HTML5 Web Storage API - see commit message [1] for list of all effective client-side log handlers [1] https://gerrit.ovirt.org/#/c/25444/
ovirt-3.6.0-3 release
Verified in rhevm-3.6.3-0.1.el6.noarch (build 3.6.3-1 RC1). User Portal and Webadmin now store client-side log messages to browser's local storage. The pattern for keys names is following: ENGINE_{UserPortal,WebAdmin}_Log_{$index,LogHead,LogSize} Legend: ENGINE_WebAdmin_Log_$index - a single "log record", $index value is within range (0, ENGINE_WebAdmin_LogSize - 1) ENGINE_WebAdmin_LogSize - number of "log records", maximum is 100, after reaching the limit, messages are rotated/overwritten ENGINE_WebAdmin_LogHead - number of the latest "log record", not index - the latest "log record" key name is equal to ENGINE_WebAdmin_Log_$(ENGINE_WebAdmin_LogHead-1) Excerpt from my browser storage: ENGINE_WebAdmin_LogHead "23" ENGINE_WebAdmin_LogSize "100" ENGINE_WebAdmin_Log_0 "Mon Feb 01 17:13:17 GMT+100 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Invoking event handler function [HostSelectionChange] for plugin [TestPlugin]" ENGINE_WebAdmin_Log_1 "Mon Feb 01 17:13:17 GMT+100 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Invoking event handler function [HostSelectionChange] for plugin [redhat_support_plugin_rhev]" ENGINE_WebAdmin_Log_10 "Tue Feb 02 13:19:23 GMT+100 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [redhat_support_plugin_rhev] reports in as ready" ENGINE_WebAdmin_Log_11 "Tue Feb 02 13:19:23 GMT+100 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [TestPlugin] has registered the event handler object" ... ... ENGINE_WebAdmin_Log_21 "Tue Feb 02 13:55:09 GMT+100 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Invoking event handler function [RestApiSessionAcquired] for plugin [TestPlugin]" ENGINE_WebAdmin_Log_22 "Tue Feb 02 13:55:09 GMT+100 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Invoking event handler function [RestApiSessionAcquired] for plugin [redhat_support_plugin_rhev]" ENGINE_WebAdmin_Log_23 "Wed Jan 27 17:54:19 GMT+100 2016 org.ovirt.engine.ui.uicompat.EnumTranslator WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'" ENGINE_WebAdmin_Log_24 "Wed Jan 27 17:54:23 GMT+100 2016 org.ovirt.engine.ui.uicompat.EnumTranslator WARNING: trying to localize null, probable error. Exception is not thrown, returning 'N/A'"