Open braydonf opened 5 years ago
This continues to be problematic and limits the usefulness of the --daemon
flag. Piping standard output to a logger will likely be the preferred way to log. A systemd, initd, kubernetes and other service scripts will be a preferable alternative to using --daemon
.
Redirecting stdout is desirable in a wide variety of use cases, from a single system process with Systemd to high-availability setups with Docker and Kubernetes. Features such as log rotation, aggregation, tagging, search indexing are included and often essential.
Versions bcoin v1.0.2 (7ceb8874ee586eb170cf4e9bba988e8b7ba2d7a6)
Expected
Heap over allocation errors, and unexpected errors, to be captured in the
debug.log
or to another log file when running./bin/bcoin --daemon
.Actual
Currently this output in not captured, and likely
stdout
is redirected to/dev/null
when running with--daemon
. The is problematic when debugging issues when running a daemon, as the error is not available, and it's unclear why the process has stopped.Reproduce
Throw an error in a function such as
node.open()
in./lib/node/fullnode.js
and run bcoin with--daemon
and the error will not be logged, try again without the option and the error will be logged.