Viewing pump.io logs¶
pump.io uses Bunyan for its logs.
Bunyan comes with a command-line tool which can format your logs’ JSON into something much prettier.
Installing the Bunyan CLI¶
The Bunyan CLI can be installed with
$ sudo npm install -g bunyan
Viewing your logs¶
To view your logs, just invoke the Bunyan CLI with the log filename
specified in your
pump.io.json, or pipe from stdin.
For example, to just pretty-print pump.io’s output:
$ pump 2>&1 | bunyan
2>&1 because pump.io prints logs to stderr.
Or, if your logs are stored at
$ bunyan /var/log/pump.io/pump.io.log.json
Bunyan logfiles can get quite large and
bunyan can take a while to
format large files, so it may be smart to only view the latest logs:
$ tail /var/log/pump.io/pump.io.log.json | bunyan
Bunyan logs are structured. You can filter them to only show (for
example) certain types of messages using the
Valid loglevels are
debug. See the Bunyan documentation for details on what
these levels mean, and note that pump.io does not use the
loglevel at all.
For example, if we wanted to show only
$ bunyan -l error
if you’re trying to view
debug messages but aren’t
seeing any, pump.io is probably not writing
messages. Try adjusting the
logLevel config option.
The Bunyan CLI has more options for filtering and output: you can see
them by invoking