Websocket logging

Registered by Honza Pokorny on 2016-07-14

We want to collect logging data from the web browser and store it in case the
operator needs it later.

The GUI already takes advantage of the Zaqar messaging system which transfers
messages between the server and the client via websockets. We can use this to
send logging messages to the server. We can create a new Zaqar queue called
*tripleo-logging* and send everything there.

The javascript application should send any useful information to the server, for
example:

* redux action messages
* exception tracebacks
* useful console.log calls
* route changes

As part of the implementation of this feature, we could

* register a global *onerror* handler which catches all exceptions, logs them
  and re-raises the original exception (this is what the sentry javascript
  client does)
* monkey-patch the *console.** functions (log, warn, debug, etc) to use the new
  logging mechanism
* convert all immutable.js data structures to plain javascript before sending

On the other side of the Zaqar queue, we shall create a simple Python script
which will be run periodically by a cronjob. This script will drain the Zaqar
queue and append the messages to a log file on disk. We can then create an
httpd vhost which would allow the client to retrieve this log file and make it
available to the user for viewing.

Blueprint information

Status:
Complete
Approver:
Emilien Macchi
Priority:
High
Drafter:
Honza Pokorny
Direction:
Approved
Assignee:
Honza Pokorny
Definition:
Approved
Series goal:
Accepted for pike
Implementation:
Implemented
Milestone target:
milestone icon pike-rc2
Started by
Emilien Macchi on 2017-06-13
Completed by
Emilien Macchi on 2017-09-08

Related branches

Sprints

Whiteboard

[jpichon 2016-11-07] This needs to be updated and moved to the TripleO tracker.

Gerrit topic for the patches already submitted at https://review.openstack.org/#/q/topic:bp/websocket-logging

Spec proposed at https://review.openstack.org/#/c/395138/

Gerrit topic: https://review.openstack.org/#q,topic:bp/websocket-logging,n,z

Addressed by: https://review.openstack.org/459294
    Implement Zaqar logger adapter

Addressed by: https://review.openstack.org/473933
    Download logs interface

Addressed by: https://review.openstack.org/469196
    Add GUI logging workflows

Addressed by: https://review.openstack.org/489134
    Add logging documentation

Addressed by: https://review.openstack.org/469608
    Add an hourly cron trigger for tripleo-ui logging

Addressed by: https://review.openstack.org/493819
    Publish logs before exporting them

Addressed by: https://review.openstack.org/493863
    Don't log app state in Zaqar by default

Addressed by: https://review.openstack.org/502364
    Add an hourly cron trigger for tripleo-ui logging

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.