Name: js-handler/node_modules/restify/node_modules/bunyan/docs/bunyan.1 
1:
.\" generated with Ronn/v0.7.3
2:
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3:
.
4:
.TH "BUNYAN" "1" "November 2012" "" "bunyan manual"
5:
.
6:
.SH "NAME"
7:
\fBbunyan\fR \- filter and pretty\-print Bunyan log file content
8:
.
9:
.SH "SYNOPSIS"
10:
\fBbunyan\fR [OPTIONS]
11:
.
12:
.P
13:
\&\.\.\. | \fBbunyan\fR [OPTIONS]
14:
.
15:
.P
16:
\fBbunyan\fR [OPTIONS] \-p PID
17:
.
18:
.SH "DESCRIPTION"
19:
"Bunyan" is \fBa simple and fast a JSON logging library\fR for node\.js services, a one\-JSON\-object\-per\-line log format, and \fBa \fBbunyan\fR CLI tool\fR for nicely viewing those logs\. This man page describes the latter\.
20:
.
21:
.SS "Pretty\-printing"
22:
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:
23:
.
24:
.IP "" 4
25:
.
26:
.nf
27:
 
28:
$ bunyan foo\.log          # or `cat foo\.log | bunyan
29:
[2012\-02\-08T22:56:52\.856Z]  INFO: myservice/123 on example\.com: My message
30:
    extra: multi
31:
    line
32:
[2012\-02\-08T22:56:54\.856Z] ERROR: myservice/123 on example\.com: My message
33:
\.\.\.
34:
.
35:
.fi
36:
.
37:
.IP "" 0
38:
.
39:
.P
40:
By default the "long" output format is used\. Use the \fB\-o FORMAT\fR option to emit other formats\. E\.g\.:
41:
.
42:
.IP "" 4
43:
.
44:
.nf
45:
 
46:
$ bunyan foo\.log \-o short
47:
22:56:52\.856Z  INFO myservice: My message
48:
    extra: multi
49:
    line
50:
22:56:54\.856Z ERROR myservice: My message
51:
\.\.\.
52:
.
53:
.fi
54:
.
55:
.IP "" 0
56:
.
57:
.P
58:
These will color the output if supported in your terminal\. See "OUTPUT FORMATS" below\.
59:
.
60:
.SS "Filtering"
61:
The \fBbunyan\fR CLI can also be used to filter a bunyan log\. Use \fB\-l LEVEL\fR to filter by level:
62:
.
63:
.IP "" 4
64:
.
65:
.nf
66:
 
67:
$ bunyan foo\.log \-l error       # show only \'error\' level records
68:
[2012\-02\-08T22:56:54\.856Z] ERROR: myservice/123 on example\.com: My message
69:
.
70:
.fi
71:
.
72:
.IP "" 0
73:
.
74:
.P
75:
Use \fB\-c COND\fR to filter on a JavaScript expression returning true on the record data\. In the COND code, \fBthis\fR refers to the record object:
76:
.
77:
.IP "" 4
78:
.
79:
.nf
80:
 
81:
$ bunyan foo\.log \-c `this\.three`     # show records with the \'extra\' field
82:
[2012\-02\-08T22:56:52\.856Z]  INFO: myservice/123 on example\.com: My message
83:
    extra: multi
84:
    line
85:
.
86:
.fi
87:
.
88:
.IP "" 0
89:
.
90:
.SH "OPTIONS"
91:
.
92:
.TP
93:
\fB\-h\fR, \fB\-\-help\fR
94:
Print this help info and exit\.
95:
.
96:
.TP
97:
\fB\-\-version\fR
98:
Print version of this command and exit\.
99:
.
100:
.TP
101:
\fB\-q\fR, \fB\-\-quiet\fR
102:
Don\'t warn if input isn\'t valid JSON\.
103:
.
104:
.P
105:
Dtrace options (only on dtrace\-supporting platforms):
106:
.
107:
.TP
108:
\fB\-p PID\fR, \fB\-p NAME\fR
109:
Process bunyan:log\-* probes from the process with the given PID\. Can be used multiple times, or specify all processes with \'*\', or a set of processes whose command & args match a pattern with \'\-p NAME\'\.
110:
.
111:
.P
112:
Filtering options:
113:
.
114:
.TP
115:
\fB\-l\fR, \fB\-\-level LEVEL\fR
116:
Only show messages at or above the specified level\. You can specify level \fInames\fR or numeric values\. (See \'Log Levels\' below\.)
117:
.
118:
.TP
119:
\fB\-c COND\fR, \fB\-\-condition COND\fR
120:
Run each log message through the condition and only show those that resolve to a truish value\. E\.g\. \fB\-c \'this\.pid == 123\'\fR\.
121:
.
122:
.TP
123:
\fB\-\-strict\fR
124:
Suppress all but legal Bunyan JSON log lines\. By default non\-JSON, and non\-Bunyan lines are passed through\.
125:
.
126:
.P
127:
Output options:
128:
.
129:
.TP
130:
\fB\-\-color\fR
131:
Colorize output\. Defaults to try if output stream is a TTY\.
132:
.
133:
.TP
134:
\fB\-\-no\-color\fR
135:
Force no coloring (e\.g\. terminal doesn\'t support it)
136:
.
137:
.TP
138:
\fB\-o FORMAT\fR, \fB\-\-output FORMAT\fR
139:
Specify an output format\. One of \fBpaul\fR (the default), \fBshort\fR, \fBjson\fR, \fBjson\-N\fR, or \fBinspect\fR\.
140:
.
141:
.TP
142:
\fB\-j\fR
143:
Shortcut for \fB\-o json\fR\.
144:
.
145:
.SH "LOG LEVELS"
146:
In Bunyan log records, then \fBlevel\fR field is a number\. For the \fB\-l|\-\-level\fR argument the level \fBnames\fR are supported as shortcuts\. In \fB\-c|\-\-condition\fR scripts, uppercase symbols like "DEBUG" are defined for convenience\.
147:
.
148:
.IP "" 4
149:
.
150:
.nf
151:
 
152:
Level Name      Level Number    Symbol in COND Scripts
153:
trace           10              TRACE
154:
debug           20              DEBUG
155:
info            30              INFO
156:
warn            40              WARN
157:
error           50              ERROR
158:
fatal           60              FATAL
159:
.
160:
.fi
161:
.
162:
.IP "" 0
163:
.
164:
.SH "OUTPUT FORMATS"
165:
.
166:
.nf
167:
 
168:
FORMAT NAME         DESCRIPTION
169:
paul (default)      The default output\. Long form\. Colored and "pretty"\.
170:
                    \'req\' and \'res\' and \'err\' fields are rendered specially
171:
                    as an HTTP request, HTTP response and exception
172:
                    stack trace, respectively\. Note: the "paul" name
173:
                    is deprecated and will be changed to "long"\.
174:
short               Like the default output, but more concise\. Some
175:
                    typically redundant fields are ellided\.
176:
json                JSON output, 2\-space indentation\.
177:
json\-N              JSON output, N\-space indentation, e\.g\. "json\-0"
178:
inspect             Node\.js `util\.inspect` output\.
179:
.
180:
.fi
181:
.
182:
.SH "DTRACE SUPPORT"
183:
On systems that support DTrace (e\.g\., MacOS, FreeBSD, illumos derivatives like SmartOS and OmniOS), Bunyan will create a DTrace provider (\fBbunyan\fR) that makes available the following probes:
184:
.
185:
.IP "" 4
186:
.
187:
.nf
188:
 
189:
log\-trace
190:
log\-debug
191:
log\-info
192:
log\-warn
193:
log\-error
194:
log\-fatal
195:
.
196:
.fi
197:
.
198:
.IP "" 0
199:
.
200:
.P
201:
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\.
202:
.
203:
.P
204:
See \fIhttps://github\.com/trentm/node\-bunyan#dtrace\-support\fR for more details and the \'\-p PID\' option above for convenience usage\.
205:
.
206:
.SH "ENVIRONMENT"
207:
.
208:
.TP
209:
\fBBUNYAN_NO_COLOR\fR
210:
Set to a non\-empty value to force no output coloring\. See \'\-\-no\-color\'\.
211:
.
212:
.SH "PROJECT & BUGS"
213:
\fBbunyan\fR is written in JavaScript and requires node\.js (\fBnode\fR)\. The project lives at \fIhttps://github\.com/trentm/node\-bunyan\fR and is published to npm as "bunyan"\.
214:
.
215:
.IP "\(bu" 4
216:
README, Install notes: \fIhttps://github\.com/trentm/node\-bunyan#readme\fR
217:
.
218:
.IP "\(bu" 4
219:
Report bugs to \fIhttps://github\.com/trentm/node\-bunyan/issues\fR\.
220:
.
221:
.IP "\(bu" 4
222:
See the full changelog at: \fIhttps://github\.com/trentm/node\-bunyan/blob/master/CHANGES\.md\fR
223:
.
224:
.IP "" 0
225:
.
226:
.SH "LICENSE"
227:
MIT License (see \fIhttps://github\.com/trentm/node\-bunyan/blob/master/LICENSE\.txt\fR)
228:
.
229:
.SH "COPYRIGHT"
230:
node\-bunyan is Copyright (c) 2012 Joyent, Inc\. Copyright (c) 2012 Trent Mick\. All rights reserved\.