BUNYAN(1)
π BUNYAN(1) β the bunyan manual, section 1 π
okay bestie, buckle up β this is the manual page for bunyan, and yes it lives in section 1 of the manual. it's a whole vibe. let's get into it π¦
β¨ NAME β¨
bunyan β filter and pretty-print Bunyan log file content. that's it, that's the job, and she does it flawlessly π
πΈ SYNOPSIS πΈ
bunyan [OPTIONS]
... | bunyan [OPTIONS]
bunyan [OPTIONS] -p PID
three whole ways to run her. pick your fighter β¨
π DESCRIPTION π
so. "Bunyan" is a simple and fast a JSON logging library for node.js services, a one-JSON-object-per-line log format, and a bunyan CLI tool for nicely viewing those logs. this man page is describing the latter β the CLI tool. not the library. the tool. iykyk π
π§ Pretty-printing
a bunyan log file is a stream of JSON objects, optionally interspersed with non-JSON log lines. the primary usage of bunyan(1) is to pretty print, for example:
$ bunyan foo.log # or `cat foo.log | bunyan
[2012-02-08T22:56:52.856Z] INFO: myservice/123 on example.com: My message
extra: multi
line
[2012-02-08T22:56:54.856Z] ERROR: myservice/123 on example.com: My message
by default the "long" output format is used. use the -o FORMAT option to emit other formats. e.g.:
$ bunyan foo.log -o short
22:56:52.856Z INFO myservice: My message
extra: multi
line
22:56:54.856Z ERROR myservice: My message
these will color the output if supported in your terminal. see "OUTPUT FORMATS" below π
π Filtering
the bunyan CLI can also be used to filter a bunyan log. use -l LEVEL to filter by level:
$ bunyan foo.log -l error # show only Β΄errorΒ΄ level records
[2012-02-08T22:56:54.856Z] ERROR: myservice/123 on example.com: My message
use -c COND to filter on a JavaScript expression returning true on the record data. in the COND code, this refers to the record object:
$ bunyan foo.log -c `this.three` # show records with the Β΄extraΒ΄ field
[2012-02-08T22:56:52.856Z] INFO: myservice/123 on example.com: My message
extra: multi
line
periodt. filter your logs, live your life π
β¨ OPTIONS β¨
-h,--helpβ print this help info and exit. classic, iconic, does exactly what it says π«Ά--versionβ print version of this command and exit. know your queen's number π-q,--quietβ don't warn if input isn't valid JSON. shhh. no notes. π€«
Dtrace options (only on dtrace-supporting platforms, so like, not everywhere bestie):
-p PID,-p NAMEβ processbunyan:log-*probes from the process with the givenPID. can be used multiple times, or specify all processes with*, or a set of processes whose command & args match a pattern with-p NAME. multitasking queen π₯
Filtering options:
-l,--level LEVELβ only show messages at or above the specified level. you can specify level names or numeric values. (see "Log Levels" below.) π-c COND,--condition CONDβ run each log message through the condition and only show those that resolve to a truish value. e.g.-c 'this.pid == 123'. it's giving selective β¨--strictβ suppress all but legal Bunyan JSON log lines. by default non-JSON, and non-Bunyan lines are passed through. strict queen behavior, honestly π
Output options:
--colorβ colorize output. defaults to try if output stream is a TTY. π--no-colorβ force no coloring (e.g. terminal doesn't support it). sad but valid π₯²-o FORMAT,--output FORMATβ specify an output format. one oflong(the default),short,json,json-N,bunyan(the native bunyan 0-indent JSON output) orinspect. pick a lane bestie, they're all cute π-jβ shortcut for-o json. because typing is hard and you're busy β‘-L,--time localβ display the time field in local time, rather than the default UTC time. timezone representation, we love to see it π
π LOG LEVELS π
in Bunyan log records, then level field is a number. for the -l|--level argument the level names are supported as shortcuts. in -c|--condition scripts, uppercase symbols like "DEBUG" are defined for convenience.
traceβ level number 10 β symbol in COND scripts:TRACEdebugβ level number 20 β symbol in COND scripts:DEBUGinfoβ level number 30 β symbol in COND scripts:INFOwarnβ level number 40 β symbol in COND scripts:WARNerrorβ level number 50 β symbol in COND scripts:ERRORfatalβ level number 60 β symbol in COND scripts:FATAL
numbers AND names, because she contains multitudes π
π OUTPUT FORMATS π
long(default) β the default output. long form. colored and "pretty".reqandresanderrfields are rendered specially as an HTTP request, HTTP response and exception stack trace, respectively. for backward compat, the name"paul"also works for this. (paul is lowkey an icon for this ngl π)shortβ like the default output, but more concise. some typically redundant fields are ellided. minimalism, but make it logs β¨jsonβ JSON output, 2-space indentation.json-Nβ JSON output, N-space indentation, e.g."json-4".bunyanβ alias for"json-0", the Bunyan "native" format. zero indent, maximum authenticity π«Άinspectβ Node.jsutil.inspectoutput.
π₯ DTRACE SUPPORT π₯
on systems that support DTrace (e.g., MacOS, FreeBSD, illumos derivatives like SmartOS and OmniOS), Bunyan will create a DTrace provider (bunyan) that makes available the following probes:
log-tracelog-debuglog-infolog-warnlog-errorlog-fatal
each of these probes has a single argument: the string that would be written to the log. note that when a probe is enabled, it will fire whenever the corresponding function is called, even if the level of the log message is less than that of any stream. yes bestie, even if. read that twice π’
see https://github.com/trentm/node-bunyan#dtrace-support for more details and the -p PID option above for convenience usage.
π¦ ENVIRONMENT π¦
BUNYAN_NO_COLORβ set to a non-empty value to force no output coloring. see--no-color. it's the vibe-killer setting, but sometimes you need it π₯²
π PROJECT & BUGS π
bunyan is written in JavaScript and requires node.js (node). the project lives at https://github.com/trentm/node-bunyan and is published to npm as "bunyan".
- README, Install notes: https://github.com/trentm/node-bunyan#readme
- Report bugs to https://github.com/trentm/node-bunyan/issues.
- See the full changelog at: https://github.com/trentm/node-bunyan/blob/master/CHANGES.md
found a bug? tell the internet. she's listening π§
π LICENSE π
MIT License (see https://github.com/trentm/node-bunyan/blob/master/LICENSE.txt)
π COPYRIGHT π
node-bunyan is Copyright (c) 2012 Joyent, Inc. Copyright (c) 2012 Trent Mick. All rights reserved.
okay that's the whole page bestie, no cap. this was the bunyan manual (that's the manual name, folded in nice and cozy near the top like i promised π«Ά), and the footer energy: January 2015, source/version bunyan. that's a wrap, you ate, go pretty-print something β¨π π
π¦ where this page comes from
- debian bookworm: node-bunyan 2.0.5+~cs4.4.3-2 Β· MIT
- ubuntu jammy: node-bunyan 2.0.5+~cs4.4.3-1 Β· MIT
- ubuntu noble: node-bunyan 2.0.5+~cs4.4.3-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms