[DAEMON-264] Output log messages for specific request
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Trivial |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | appcd-logger |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2018-10-08T22:07:20.000+0000 |
Updated | 2020-02-13T07:20:34.000+0000 |
Description
There is no per-request log output. There's a massive log stream accessible via
appcd logcat
or appcd dump
, but they are subject to size limitations and timing.
It would be amazing if there was a way to output or write to disk a log messages generated by a single request.
However, this task is not straightforward. Given the decoupled architecture of the daemon and its plugins, it's impossible to track log messages without having some sort of request ID. In other words, we can only support this feature with requests coming from WebSocket sessions and not HTTP because the Appc Daemon WebSocket protocol mandates each request have a unique ID.
We need to think about how to link that request ID to log messages generated by the request. The log stream is essentially a global object which means there is a single point of entry across the entire daemon. Perhaps it's possible to proxy all log messages per context before they are written to the logger in which we can tag the log messages with the request ID?
Its worth noting that ALL logging is performed in the appcd-core
. All plugins ship their log messages through the IPC tunnel, so whatever solution works for code running internally in the daemon should also work in plugins.
No comments