Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bunyan.1.ronn 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # bunyan(1) -- filter and pretty-print Bunyan log file content
  2. ## SYNOPSIS
  3. `bunyan` \[OPTIONS\]
  4. ... | `bunyan` \[OPTIONS\]
  5. `bunyan` \[OPTIONS\] -p PID
  6. ## DESCRIPTION
  7. "Bunyan" is **a simple and fast a JSON logging library** for node.js services,
  8. a one-JSON-object-per-line log format, and **a `bunyan` CLI tool** for nicely
  9. viewing those logs. This man page describes the latter.
  10. ### Pretty-printing
  11. A bunyan log file is a stream of JSON objects, optionally interspersed with
  12. non-JSON log lines. The primary usage of bunyan(1) is to pretty print,
  13. for example:
  14. $ bunyan foo.log # or `cat foo.log | bunyan
  15. [2012-02-08T22:56:52.856Z] INFO: myservice/123 on example.com: My message
  16. extra: multi
  17. line
  18. [2012-02-08T22:56:54.856Z] ERROR: myservice/123 on example.com: My message
  19. ...
  20. By default the "long" output format is used. Use the `-o FORMAT` option to
  21. emit other formats. E.g.:
  22. $ bunyan foo.log -o short
  23. 22:56:52.856Z INFO myservice: My message
  24. extra: multi
  25. line
  26. 22:56:54.856Z ERROR myservice: My message
  27. ...
  28. These will color the output if supported in your terminal.
  29. See "OUTPUT FORMATS" below.
  30. ### Filtering
  31. The `bunyan` CLI can also be used to filter a bunyan log. Use `-l LEVEL`
  32. to filter by level:
  33. $ bunyan foo.log -l error # show only 'error' level records
  34. [2012-02-08T22:56:54.856Z] ERROR: myservice/123 on example.com: My message
  35. Use `-c COND` to filter on a JavaScript expression returning true on the
  36. record data. In the COND code, `this` refers to the record object:
  37. $ bunyan foo.log -c `this.three` # show records with the 'extra' field
  38. [2012-02-08T22:56:52.856Z] INFO: myservice/123 on example.com: My message
  39. extra: multi
  40. line
  41. ## OPTIONS
  42. * `-h`, `--help`:
  43. Print this help info and exit.
  44. * `--version`:
  45. Print version of this command and exit.
  46. * `-q`, `--quiet`:
  47. Don't warn if input isn't valid JSON.
  48. Dtrace options (only on dtrace-supporting platforms):
  49. * `-p PID`, `-p NAME`:
  50. Process bunyan:log-\* probes from the process with the given PID.
  51. Can be used multiple times, or specify all processes with '\*',
  52. or a set of processes whose command & args match a pattern with
  53. '-p NAME'.
  54. Filtering options:
  55. * `-l`, `--level LEVEL`:
  56. Only show messages at or above the specified level. You can specify level
  57. *names* or numeric values. (See 'Log Levels' below.)
  58. * `-c COND`, `--condition COND`:
  59. Run each log message through the condition and only show those that
  60. resolve to a truish value. E.g. `-c 'this.pid == 123'`.
  61. * `--strict`:
  62. Suppress all but legal Bunyan JSON log lines. By default non-JSON, and
  63. non-Bunyan lines are passed through.
  64. Output options:
  65. * `--color`:
  66. Colorize output. Defaults to try if output stream is a TTY.
  67. * `--no-color`:
  68. Force no coloring (e.g. terminal doesn't support it)
  69. * `-o FORMAT`, `--output FORMAT`:
  70. Specify an output format. One of `long` (the default), `short`, `json`,
  71. `json-N`, `bunyan` (the native bunyan 0-indent JSON output) or `inspect`.
  72. * `-j`:
  73. Shortcut for `-o json`.
  74. * `-L`, `--time local`:
  75. Display the time field in *local* time, rather than the default UTC
  76. time.
  77. ## LOG LEVELS
  78. In Bunyan log records, then `level` field is a number. For the `-l|--level`
  79. argument the level **names** are supported as shortcuts. In `-c|--condition`
  80. scripts, uppercase symbols like "DEBUG" are defined for convenience.
  81. Level Name Level Number Symbol in COND Scripts
  82. trace 10 TRACE
  83. debug 20 DEBUG
  84. info 30 INFO
  85. warn 40 WARN
  86. error 50 ERROR
  87. fatal 60 FATAL
  88. ## OUTPUT FORMATS
  89. FORMAT NAME DESCRIPTION
  90. long (default) The default output. Long form. Colored and "pretty".
  91. 'req' and 'res' and 'err' fields are rendered specially
  92. as an HTTP request, HTTP response and exception
  93. stack trace, respectively. For backward compat, the
  94. name "paul" also works for this.
  95. short Like the default output, but more concise. Some
  96. typically redundant fields are ellided.
  97. json JSON output, 2-space indentation.
  98. json-N JSON output, N-space indentation, e.g. "json-4"
  99. bunyan Alias for "json-0", the Bunyan "native" format.
  100. inspect Node.js `util.inspect` output.
  101. ## DTRACE SUPPORT
  102. On systems that support DTrace (e.g., MacOS, FreeBSD, illumos derivatives
  103. like SmartOS and OmniOS), Bunyan will create a DTrace provider (`bunyan`)
  104. that makes available the following probes:
  105. log-trace
  106. log-debug
  107. log-info
  108. log-warn
  109. log-error
  110. log-fatal
  111. Each of these probes has a single argument: the string that would be
  112. written to the log. Note that when a probe is enabled, it will
  113. fire whenever the corresponding function is called, even if the level of
  114. the log message is less than that of any stream.
  115. See <https://github.com/trentm/node-bunyan#dtrace-support> for more details
  116. and the '-p PID' option above for convenience usage.
  117. ## ENVIRONMENT
  118. * `BUNYAN_NO_COLOR`:
  119. Set to a non-empty value to force no output coloring. See '--no-color'.
  120. ## PROJECT & BUGS
  121. `bunyan` is written in JavaScript and requires node.js (`node`). The project
  122. lives at <https://github.com/trentm/node-bunyan> and is published to npm as
  123. "bunyan".
  124. * README, Install notes: <https://github.com/trentm/node-bunyan#readme>
  125. * Report bugs to <https://github.com/trentm/node-bunyan/issues>.
  126. * See the full changelog at: <https://github.com/trentm/node-bunyan/blob/master/CHANGES.md>
  127. ## LICENSE
  128. MIT License (see <https://github.com/trentm/node-bunyan/blob/master/LICENSE.txt>)
  129. ## COPYRIGHT
  130. node-bunyan is Copyright (c) 2012 Joyent, Inc. Copyright (c) 2012 Trent Mick.
  131. All rights reserved.