You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The debug-ability of the Tool Meisters running remotely is very difficult
without a way to properly capture log output from them. We take three
major steps to address this.
The first step is to not use a Python logger until we will (or would
have otherwise) daemonized the process. This allows us to emit error
messages on stderr, which will be exposed in the callers context. Once
we are daemonized, `stdout` and `stderr` are detached from the caller,
so logging to some place other than `stdout`/`stderr` is the best
option from that point forward.
The second step is to recognize that logging to a file on a remote host
is useless unless the operator can get a hold of that log file.
However, remote Tool Meisters use a temporary directory, so writing to a
file will just be lost when the temporary directory is removed by the
process of shutting down the Tool Meister. Instead, we now log to
`/dev/log` when daemonized. We then add the ability to run the Tool
Meister without daemonizing so that in a container we can log to
`stdout`/`stderr` to leverage the normal container logging mechanism.
As a result of making this change, we introduce a method to request the
Tool Meister not be daemonized, and re-organize the code a bit so that
we can take advantage of those two environments.
The third step is to add the ability for each Tool Meister to send
logs back to the Tool Data Sink via Redis, so that the Tool Data Sink
can collect them into a single log file making it easier to see what
happened remotely. If the Redis server logging fails, then the
operator can fall back to looking for Tool Meister logs in the
container logs or in the remote host's normal syslog sink.
Finally, we address dropped connections to the Redis server so that
both the Tool Meister and the Tool Data Sink handle that a bit more
gracefully.
0 commit comments