Bug 1049409 - [RFE] Persistent client-side logging infrastructure
Summary: [RFE] Persistent client-side logging infrastructure
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RFEs
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Vojtech Szocs
QA Contact: Pavel Novotny
URL:
Whiteboard:
Depends On:
Blocks: 1210446
TreeView+ depends on / blocked
 
Reported: 2014-01-07 14:44 UTC by Vojtech Szocs
Modified: 2016-02-10 12:50 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-02-10 12:50:00 UTC
oVirt Team: UX
Embargoed:
rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
pnovotny: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1179897 0 unspecified CLOSED [RFE] Implement client-side JavaScript stacktrace de-obfuscation 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1210446 0 unspecified CLOSED [RFE] webapp client logs should be accessible and tuneable in production builds 2021-08-30 11:46:39 UTC
Red Hat Bugzilla 1215727 0 unspecified CLOSED Whenever an exception is thrown in the front end code, unrelated parts of the GUI tend to stop working (e.g. 'new' and '... 2021-02-22 00:41:40 UTC
oVirt gerrit 25444 0 master MERGED webadmin,userportal: Persistent client-side logging infra Never

Internal Links: 1179897 1210446 1215727

Description Vojtech Szocs 2014-01-07 14:44:03 UTC
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

Comment 1 Vojtech Szocs 2015-05-19 10:10:48 UTC
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/

Comment 2 Max Kovgan 2015-06-28 14:12:11 UTC
ovirt-3.6.0-3 release

Comment 3 Pavel Novotny 2016-02-02 16:39:05 UTC
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'"


Note You need to log in before you can comment on or make changes to this bug.