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.

CHANGES.md 45KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346
  1. # bunyan Changelog
  2. Known issues:
  3. - [issue #58] Can't install to a dir with spaces. This is [this node-gyp
  4. bug](https://github.com/TooTallNate/node-gyp/issues/65).
  5. ## not yet released
  6. (nothing yet)
  7. ## 1.8.12
  8. - [issue #444] Fix the `bunyan` CLI to not duplicate the "HTTP/1.1 ..." status
  9. line when serializing a "res" field.
  10. ## 1.8.11
  11. - [issue #504] The `bunyan` 1.x CLI adds a `Host: $client_req.address[:$client_req.port]`
  12. header when rendering a `client_req` field in a log record. Fix that here to:
  13. (a) not add it if `client_req.headers` already includes a host header; and
  14. (b) not include the given `port` if it is 80 or 443 (*assuming* that is the
  15. default port.
  16. Note: `bunyan` 2.x CLI will stop adding this Host header because it is a guess
  17. that can be wrong and misleading.
  18. ## 1.8.10
  19. - Ensure that `bunyan` errors out if attempting to use `-p PID` and
  20. file args at the same time.
  21. ## 1.8.9
  22. - [pull #409, issue #246] Revert a change added to the `bunyan` CLI version
  23. 1.0.1 where `SIGINT` was ignored, such that Ctrl+C could not be used to
  24. terminate bunyan. (By @zbjornson and @davepacheco.)
  25. - [pull #469] Fix a strict mode (`"use strict;"`) error in some versions of
  26. Safari.
  27. ## 1.8.8
  28. - Fix breakage due to a silly last minute "fix 'make check'".
  29. ## 1.8.7
  30. Note: *Bad release.* Use 1.8.8 or later.
  31. - [issue #484] Fix breakage due to #474 in previous release.
  32. ## 1.8.6
  33. Note: *Bad release.* Use 1.8.7 or later.
  34. - [issue #474] Bunyan's `safeCycles` is too slow when logging large objects.
  35. ## 1.8.5
  36. - [issue #401] Improved performance when using disabled log levels.
  37. ## 1.8.4
  38. - [issue #454] Fix `src` usage with node v7.
  39. ## 1.8.3
  40. - [issue #450] Fix `log.info(null)` crash that resulted from #426 in v1.8.2.
  41. ## 1.8.2
  42. - [issue #449] Bump dtrace-provider dep to 0.7.0 to help avoid deprecation
  43. warnings with node v6 in some cases.
  44. - [issue #426] Ensure `log.info({err: err})` results in a "msg" value, just
  45. like `log.info(err)`.
  46. ## 1.8.1
  47. - [pull #386] Fix bad bug in rotation that could cause a crash with
  48. error message "cannot start a rotation when already rotating"
  49. (by Frankie O'Rourke). The bug was introduced in 1.8.0.
  50. ## 1.8.0
  51. Note: *Bad release.* An addition in this release broke 'rotating-file' usage.
  52. Use 1.8.1 or later.
  53. - [issue #370] Fix `bunyan -p ...` (i.e. DTrace integration) on node
  54. 4.x and 5.x.
  55. - [issue #329, pull #330] Update the 'rotating-file' stream to do a file
  56. rotation on initialization if the mtime on the file path indicates the
  57. last rotation time was missed -- i.e. if the app wasn't running at the
  58. time. (by Paul Milham.)
  59. ## 1.7.1
  60. - [issue #332, pull #355] Ensure stream for type='stream' stream is a writable
  61. stream. (By Michael Nisi.)
  62. - [issue #344] Fix "rotating-file" Bunyan streams to not miss rotations when configured
  63. for a period greater than approximately 25 days. Before this there was an issue
  64. where periods greater than node.js's maximum `setTimeout` length would fail to rotate.
  65. (By Martijn Schrage.)
  66. - [issue #234, pull #345] Improve `bunyan` CLI rendering of "res" field
  67. HTTP responses to not show two blank lines for an empty body.
  68. (By Michael Nisi.)
  69. ## 1.7.0
  70. - [pull #311, #302, #310] Improve the runtime environment detection to fix
  71. running under [NW.js](http://nwjs.io/). Contributions by Adam Lynch, Jeremy
  72. Ruppel, and Aleksey Timchenko.
  73. - [pull #318] Add `reemitErrorEvents` optional boolean for streams added to a
  74. Bunyan logger to control whether an "error" event on the stream will be
  75. re-emitted on the `Logger` instance.
  76. var log = bunyan.createLogger({
  77. name: 'foo',
  78. streams: [
  79. {
  80. type: 'raw',
  81. stream: new MyCustomStream(),
  82. reemitErrorEvents: true
  83. }
  84. ]
  85. });
  86. Before this change, "error" events were re-emitted on [`file`
  87. streams](https://github.com/trentm/node-bunyan#stream-type-file) only. The new
  88. behaviour is as follows:
  89. - `reemitErrorEvents` not specified: `file` streams will re-emit error events
  90. on the Logger instance.
  91. - `reemitErrorEvents: true`: error events will be re-emitted on the Logger
  92. for any stream with a `.on()` function -- which includes file streams,
  93. process.stdout/stderr, and any object that inherits from EventEmitter.
  94. - `reemitErrorEvents: false`: error events will not be re-emitted for any
  95. streams.
  96. Dev Note: Bunyan `Logger` objects don't currently have a `.close()` method
  97. in which registered error event handlers can be *un*registered. That means
  98. that a (presumably rare) situation where code adds dozens of Bunyan Logger
  99. streams to, e.g. process.stdout, and with `reemitErrorEvents: true`, could
  100. result in leaking Logger objects.
  101. Original work for allowing "error" re-emitting on non-file streams is
  102. by Marc Udoff in pull #318.
  103. ## 1.6.0
  104. - [pull #304, issue #245] Use [Moment.js][momentjs.com] library to handle
  105. `bunyan` CLI time formatting in some cases, especially to fix display of
  106. local time. It is now required for local time formatting (i.e. `bunyan -L`
  107. or `bunyan --time local`). (By David M. Lee.)
  108. - [pull #252] Fix errant `client_res={}` in `bunyan` CLI rendering, and avoid
  109. extra newlines in `client_req` rendering in some cases. (By Thomas Heymann.)
  110. - [pull #291, issue #303] Fix `LOG.child(...)` to *not* override the "hostname"
  111. field of the parent. A use case is when one manually sets "hostname" to
  112. something other than `os.hostname()`. (By github.com/Cactusbone.)
  113. - [issue #325] Allow one to set `level: 0` in `createLogger` to turn on
  114. logging for all levels. (Adapted from #336 by github.com/sometimesalready.)
  115. - Add guards (to `resolveLevel`) so that all "level" values are validated.
  116. Before this, a bogus level like "foo" or -12 or `['some', 'array']` would
  117. silently be accepted -- with undefined results.
  118. - Doc updates for #340 and #305.
  119. - Update `make test` to test against node 5, 4, 0.12 and 0.10.
  120. ## 1.5.1
  121. - [issue #296] Fix `src: true`, which was broken in v1.5.0.
  122. ## 1.5.0
  123. Note: *Bad release.* The addition of `'use strict';` broke Bunyan's `src: true`
  124. feature. Use 1.5.1 instead.
  125. - [pull #236, issue #231, issue #223] Fix strict mode in the browser.
  126. - [pull #282, issue #213] Fixes bunyan to work with webpack. By Denis Izmaylov.
  127. - [pull #294] Update to dtrace-provider 0.6 to fix with node 4.0 and io.js 3.0.
  128. - Dropped support for 0.8 (can't install deps easily anymore for running
  129. test suite). Bump to a recent iojs version for testing.
  130. ## 1.4.0
  131. (Bumping minor ver b/c I'm wary of dtrace-provider changes. :)
  132. - [issue #258, pull #259] Update to dtrace-provider 0.5 to fix
  133. install and tests on recent io.js versions.
  134. - safe-json-stringify@1.0.3 changed output, breaking some tests. Fix those.
  135. ## 1.3.6
  136. - [issue #244] Make `bunyan` defensive on `res.header=null`.
  137. ## 1.3.5
  138. - [issue #233] Make `bunyan` defensive on res.header as a boolean.
  139. - [issue #242] Make `bunyan` defensive on err.stack not being a string.
  140. ## 1.3.4
  141. - Allow `log.child(...)` to work even if the logger is a *sub-class*
  142. of Bunyan's Logger class.
  143. - [issue #219] Hide 'source-map-support' require from browserify.
  144. - [issue #218] Reset `haveNonRawStreams` on `<logger>.addStream`.
  145. ## 1.3.3
  146. - [pull #127] Update to dtrace-provider 0.4.0, which gives io.js 1.x support
  147. for dtrace-y parts of Bunyan.
  148. ## 1.3.2
  149. - [pull #182] Fallback to using the optional 'safe-json-stringify' module
  150. if `JSON.stringify` throws -- possibly with an enumerable property
  151. getter than throws. By Martin Gausby.
  152. ## 1.3.1
  153. - Export `bunyan.RotatingFileStream` which is needed if one wants to
  154. customize it. E.g. see issue #194.
  155. - [pull #122] Source Map support for caller line position for [the "src"
  156. field](https://github.com/trentm/node-bunyan#src). This could be interesting
  157. for [CoffeeScript](http://coffeescript.org/documentation/docs/sourcemap.html)
  158. users of Bunyan. By Manuel Schneider.
  159. - [issue #164] Ensure a top-level `level` given in `bunyan.createLogger`
  160. is *used* for given `streams`. For example, ensure that the following
  161. results in the stream having a DEBUG level:
  162. var log = bunyan.createLogger({
  163. name: 'foo',
  164. level: 'debug',
  165. streams: [
  166. {
  167. path: '/var/tmp/foo.log'
  168. }
  169. ]
  170. });
  171. This was broken in the 1.0.1 release. Between that release and 1.3.0
  172. the "/var/tmp/foo.log" stream would be at the INFO level (Bunyan's
  173. default level).
  174. ## 1.3.0
  175. - [issue #103] `bunyan -L` (or `bunyan --time local`) to show local time.
  176. Bunyan log records store `time` in UTC time. Sometimes it is convenient
  177. to display in local time.
  178. - [issue #205] Fix the "The Bunyan CLI crashed!" checking to properly warn of
  179. the common failure case when `-c CONDITION` is being used.
  180. ## 1.2.4
  181. - [issue #210] Export `bunyan.nameFromLevel` and `bunyan.levelFromName`. It can
  182. be a pain for custom streams to have to reproduce that.
  183. - [issue #100] Gracefully handle the case of an unbound
  184. `Logger.{info,debug,...}` being used for logging, e.g.:
  185. myEmittingThing.on('data', log.info)
  186. Before this change, bunyan would throw. Now it emits a warning to stderr
  187. *once*, and then silently ignores those log attempts, e.g.:
  188. bunyan usage error: /Users/trentm/tm/node-bunyan/foo.js:12: attempt to log with an unbound log method: `this` is: { _events: { data: [Function] } }
  189. ## 1.2.3
  190. - [issue #184] Fix log rotation for rotation periods > ~25 days. Before this
  191. change, a rotation period longer than this could hit [the maximum setTimeout
  192. delay in node.js](https://github.com/joyent/node/issues/8656). By Daniel Juhl.
  193. ## 1.2.2
  194. - Drop the guard that a bunyan Logger level must be between TRACE (10)
  195. and FATAL (60), inclusive. This allows a trick of setting the level
  196. to `FATAL + 1` to turn logging off. While the standard named log levels are
  197. the golden path, then intention was not to get in the way of using
  198. other level numbers.
  199. ## 1.2.1
  200. - [issue #178, #181] Get at least dtrace-provider 0.3.1 for
  201. optionalDependencies to get a fix for install with decoupled npm (e.g. with
  202. homebrew's node and npm).
  203. ## 1.2.0
  204. - [issue #157] Restore dtrace-provider as a dependency (in
  205. "optionalDependencies").
  206. Dtrace-provider version 0.3.0 add build sugar that should eliminate the
  207. problems from older versions:
  208. The build is not attempted on Linux and Windows. The build spew is
  209. *not* emitted by default (use `V=1 npm install` to see it); instead a
  210. short warning is emitted if the build fails.
  211. Also, importantly, the new dtrace-provider fixes working with node
  212. v0.11/0.12.
  213. ## 1.1.3
  214. - [issue #165] Include extra `err` fields in `bunyan` CLI output. Before
  215. this change only the fields part of the typical node.js error stack
  216. (err.stack, err.message, err.name) would be emitted, even though
  217. the Bunyan *library* would typically include err.code and err.signal
  218. in the raw JSON log record.
  219. ## 1.1.2
  220. - Fix a breakage in `log.info(err)` on a logger with no serializers.
  221. ## 1.1.1
  222. Note: *Bad release.* It breaks `log.info(err)` on a logger with no serializers.
  223. Use version 1.1.2.
  224. - [pull #168] Fix handling of `log.info(err)` to use the `log` Logger's `err`
  225. serializer if it has one, instead of always using the core Bunyan err
  226. serializer. (By Mihai Tomescu.)
  227. ## 1.1.0
  228. - [issue #162] Preliminary support for [browserify](http://browserify.org/).
  229. See [the section in the README](../README.md#browserify).
  230. ## 1.0.1
  231. - [issues #105, #138, #151] Export `<Logger>.addStream(...)` and
  232. `<Logger>.addSerializers(...)` to be able to add them after Logger creation.
  233. Thanks @andreineculau!
  234. - [issue #159] Fix bad handling in construtor guard intending to allow
  235. creation without "new": `var log = Logger(...)`. Thanks @rmg!
  236. - [issue #156] Smaller install size via .npmignore file.
  237. - [issue #126, #161] Ignore SIGINT (Ctrl+C) when processing stdin. `...| bunyan`
  238. should expect the preceding process in the pipeline to handle SIGINT. While
  239. it is doing so, `bunyan` should continue to process any remaining output.
  240. Thanks @timborodin and @jnordberg!
  241. - [issue #160] Stop using ANSI 'grey' in `bunyan` CLI output, because of the
  242. problems that causes with Solarized Dark themes (see
  243. <https://github.com/altercation/solarized/issues/220>).
  244. ## 1.0.0
  245. - [issue #87] **Backward incompatible change to `-c CODE`** improving
  246. performance by over 10x (good!), with a backward incompatible change to
  247. semantics (unfortunate), and adding some sugar (good!).
  248. The `-c CODE` implementation was changed to use a JS function for processing
  249. rather than `vm.runInNewContext`. The latter was specatularly slow, so
  250. won't be missed. Unfortunately this does mean a few semantic differences in
  251. the `CODE`, the most noticeable of which is that **`this` is required to
  252. access the object fields:**
  253. # Bad. Works with bunyan 0.x but not 1.x.
  254. $ bunyan -c 'pid === 123' foo.log
  255. ...
  256. # Good. Works with all versions of bunyan
  257. $ bunyan -c 'this.pid === 123' foo.log
  258. ...
  259. The old behaviour of `-c` can be restored with the `BUNYAN_EXEC=vm`
  260. environment variable:
  261. $ BUNYAN_EXEC=vm bunyan -c 'pid === 123' foo.log
  262. ...
  263. Some sugar was also added: the TRACE, DEBUG, ... constants are defined, so
  264. one can:
  265. $ bunyan -c 'this.level >= ERROR && this.component === "http"' foo.log
  266. ...
  267. And example of the speed improvement on a 10 MiB log example:
  268. $ time BUNYAN_EXEC=vm bunyan -c 'this.level === ERROR' big.log | cat >slow
  269. real 0m6.349s
  270. user 0m6.292s
  271. sys 0m0.110s
  272. $ time bunyan -c 'this.level === ERROR' big.log | cat >fast
  273. real 0m0.333s
  274. user 0m0.303s
  275. sys 0m0.028s
  276. The change was courtesy Patrick Mooney (https://github.com/pfmooney). Thanks!
  277. - Add `bunyan -0 ...` shortcut for `bunyan -o bunyan ...`.
  278. - [issue #135] **Backward incompatible.** Drop dtrace-provider even from
  279. `optionalDependencies`. Dtrace-provider has proven a consistent barrier to
  280. installing bunyan, because it is a binary dep. Even as an *optional* dep it
  281. still caused confusion and install noise.
  282. Users of Bunyan on dtrace-y platforms (SmartOS, Mac, Illumos, Solaris) will
  283. need to manually `npm install dtrace-provider` themselves to get [Bunyan's
  284. dtrace support](https://github.com/trentm/node-bunyan#runtime-log-snooping-via-dtrace)
  285. to work. If not installed, bunyan should stub it out properly.
  286. ## 0.23.1
  287. - [pull #125, pull #97, issue #73] Unref rotating-file timeout which was
  288. preventing processes from exiting (by https://github.com/chakrit and
  289. https://github.com/glenn-murray-bse). Note: this only fixes the issue
  290. for node 0.10 and above.
  291. ## 0.23.0
  292. - [issue #139] Fix `bunyan` crash on a log record with `res.header` that is an
  293. object. A side effect of this improvement is that a record with `res.statusCode`
  294. but no header info will render a response block, for example:
  295. [2012-08-08T10:25:47.637Z] INFO: my-service/12859 on my-host: some message (...)
  296. ...
  297. --
  298. HTTP/1.1 200 OK
  299. --
  300. ...
  301. - [pull #42] Fix `bunyan` crash on a log record with `req.headers` that is a *string*
  302. (by https://github.com/aexmachina).
  303. - Drop node 0.6 support. I can't effectively `npm install` with a node 0.6
  304. anymore.
  305. - [issue #85] Ensure logging a non-object/non-string doesn't throw (by
  306. https://github.com/mhart). This changes fixes:
  307. log.info(<bool>) # TypeError: Object.keys called on non-object
  308. log.info(<function>) # "msg":"" (instead of wanted "msg":"[Function]")
  309. log.info(<array>) # "msg":"" (instead of wanted "msg":util.format(<array>))
  310. ## 0.22.3
  311. - Republish the same code to npm.
  312. ## 0.22.2
  313. Note: Bad release. The published package in the npm registry got corrupted. Use 0.22.3 or later.
  314. - [issue #131] Allow `log.info(<number>)` and, most importantly, don't crash on that.
  315. - Update 'mv' optional dep to latest.
  316. ## 0.22.1
  317. - [issue #111] Fix a crash when attempting to use `bunyan -p` on a platform without
  318. dtrace.
  319. - [issue #101] Fix a crash in `bunyan` rendering a record with unexpected "res.headers".
  320. ## 0.22.0
  321. - [issue #104] `log.reopenFileStreams()` convenience method to be used with external log
  322. rotation.
  323. ## 0.21.4
  324. - [issue #96] Fix `bunyan` to default to paging (with `less`) by default in node 0.10.0.
  325. The intention has always been to default to paging for node >=0.8.
  326. ## 0.21.3
  327. - [issue #90] Fix `bunyan -p '*'` breakage in version 0.21.2.
  328. ## 0.21.2
  329. **Note: Bad release. The switchrate change below broke `bunyan -p '*'` usage
  330. (see issue #90). Use 0.21.3 or later.**
  331. - [issue #88] Should be able to efficiently combine "-l" with "-p *".
  332. - Avoid DTrace buffer filling up, e.g. like this:
  333. $ bunyan -p 42241 > /tmp/all.log
  334. dtrace: error on enabled probe ID 3 (ID 75795: bunyan42241:mod-87ea640:log-trace:log-trace): out of scratch space in action #1 at DIF offset 12
  335. dtrace: error on enabled probe ID 3 (ID 75795: bunyan42241:mod-87ea640:log-trace:log-trace): out of scratch space in action #1 at DIF offset 12
  336. dtrace: 138 drops on CPU 4
  337. ...
  338. From Bryan: "the DTrace buffer is filling up because the string size is so
  339. large... by increasing the switchrate, you're increasing the rate at
  340. which that buffer is emptied."
  341. ## 0.21.1
  342. - [pull #83] Support rendering 'client_res' key in bunyan CLI (by
  343. github.com/mcavage).
  344. ## 0.21.0
  345. - 'make check' clean, 4-space indenting. No functional change here, just
  346. lots of code change.
  347. - [issue #80, #82] Drop assert that broke using 'rotating-file' with
  348. a default `period` (by github.com/ricardograca).
  349. ## 0.20.0
  350. - [Slight backward incompatibility] Fix serializer bug introduced in 0.18.3
  351. (see below) to only apply serializers to log records when appropriate.
  352. This also makes a semantic change to custom serializers. Before this change
  353. a serializer function was called for a log record key when that value was
  354. truth-y. The semantic change is to call the serializer function as long
  355. as the value is not `undefined`. That means that a serializer function
  356. should handle falsey values such as `false` and `null`.
  357. - Update to latest 'mv' dep (required for rotating-file support) to support
  358. node v0.10.0.
  359. ## 0.19.0
  360. **WARNING**: This release includes a bug introduced in bunyan 0.18.3 (see
  361. below). Please upgrade to bunyan 0.20.0.
  362. - [Slight backward incompatibility] Change the default error serialization
  363. (a.k.a. `bunyan.stdSerializers.err`) to *not* serialize all additional
  364. attributes of the given error object. This is an open door to unsafe logging
  365. and logging should always be safe. With this change, error serialization
  366. will log these attributes: message, name, stack, code, signal. The latter
  367. two are added because some core node APIs include those fields (e.g.
  368. `child_process.exec`).
  369. Concrete examples where this has hurt have been the "domain" change
  370. necessitating 0.18.3 and a case where
  371. [node-restify](https://github.com/mcavage/node-restify) uses an error object
  372. as the response object. When logging the `err` and `res` in the same log
  373. statement (common for restify audit logging), the `res.body` would be JSON
  374. stringified as '[Circular]' as it had already been emitted for the `err` key.
  375. This results in a WTF with the bunyan CLI because the `err.body` is not
  376. rendered.
  377. If you need the old behaviour back you will need to do this:
  378. var bunyan = require('bunyan');
  379. var errSkips = {
  380. // Skip domain keys. `domain` especially can have huge objects that can
  381. // OOM your app when trying to JSON.stringify.
  382. domain: true,
  383. domain_emitter: true,
  384. domain_bound: true,
  385. domain_thrown: true
  386. };
  387. bunyan.stdSerializers.err = function err(err) {
  388. if (!err || !err.stack)
  389. return err;
  390. var obj = {
  391. message: err.message,
  392. name: err.name,
  393. stack: getFullErrorStack(err)
  394. }
  395. Object.keys(err).forEach(function (k) {
  396. if (err[k] !== undefined && !errSkips[k]) {
  397. obj[k] = err[k];
  398. }
  399. });
  400. return obj;
  401. };
  402. - "long" and "bunyan" output formats for the CLI. `bunyan -o long` is the default
  403. format, the same as before, just called "long" now instead of the cheesy "paul"
  404. name. The "bunyan" output format is the same as "json-0", just with a more
  405. convenient name.
  406. ## 0.18.3
  407. **WARNING**: This release introduced a bug such that all serializers are
  408. applied to all log records even if the log record did not contain the key
  409. for that serializer. If a logger serializer function does not handle
  410. being given `undefined`, then you'll get warnings like this on stderr:
  411. bunyan: ERROR: This should never happen. This is a bug in <https://github.com/trentm/node-bunyan> or in this application. Exception from "foo" Logger serializer: Error: ...
  412. at Object.bunyan.createLogger.serializers.foo (.../myapp.js:20:15)
  413. at Logger._applySerializers (.../lib/bunyan.js:644:46)
  414. at Array.forEach (native)
  415. at Logger._applySerializers (.../lib/bunyan.js:640:33)
  416. ...
  417. and the following junk in written log records:
  418. "foo":"(Error in Bunyan log "foo" serializer broke field. See stderr for details.)"
  419. Please upgrade to bunyan 0.20.0.
  420. - Change the `bunyan.stdSerializers.err` serializer for errors to *exclude*
  421. [the "domain*" keys](http://nodejs.org/docs/latest/api/all.html#all_additions_to_error_objects).
  422. `err.domain` will include its assigned members which can arbitrarily large
  423. objects that are not intended for logging.
  424. - Make the "dtrace-provider" dependency optional. I hate to do this, but
  425. installing bunyan on Windows is made very difficult with this as a required
  426. dep. Even though "dtrace-provider" stubs out for non-dtrace-y platforms,
  427. without a compiler and Python around, node-gyp just falls over.
  428. ## 0.18.2
  429. - [pull #67] Remove debugging prints in rotating-file support.
  430. (by github.com/chad3814).
  431. - Update to dtrace-provider@0.2.7.
  432. ## 0.18.1
  433. - Get the `bunyan` CLI to **not** automatically page (i.e. pipe to `less`)
  434. if stdin isn't a TTY, or if following dtrace probe output (via `-p PID`),
  435. or if not given log file arguments.
  436. ## 0.18.0
  437. - Automatic paging support in the `bunyan` CLI (similar to `git log` et al).
  438. IOW, `bunyan` will open your pager (by default `less`) and pipe rendered
  439. log output through it. A main benefit of this is getting colored logs with
  440. a pager without the pain. Before you had to explicit use `--color` to tell
  441. bunyan to color output when the output was not a TTY:
  442. bunyan foo.log --color | less -R # before
  443. bunyan foo.log # now
  444. Disable with the `--no-pager` option or the `BUNYAN_NO_PAGER=1` environment
  445. variable.
  446. Limitations: Only supported for node >=0.8. Windows is not supported (at
  447. least not yet).
  448. - Switch test suite to nodeunit (still using a node-tap'ish API via
  449. a helper).
  450. ## 0.17.0
  451. - [issue #33] Log rotation support:
  452. var bunyan = require('bunyan');
  453. var log = bunyan.createLogger({
  454. name: 'myapp',
  455. streams: [{
  456. type: 'rotating-file',
  457. path: '/var/log/myapp.log',
  458. count: 7,
  459. period: 'daily'
  460. }]
  461. });
  462. - Tweak to CLI default pretty output: don't special case "latency" field.
  463. The special casing was perhaps nice, but less self-explanatory.
  464. Before:
  465. [2012-12-27T21:17:38.218Z] INFO: audit/45769 on myserver: handled: 200 (15ms, audit=true, bar=baz)
  466. GET /foo
  467. ...
  468. After:
  469. [2012-12-27T21:17:38.218Z] INFO: audit/45769 on myserver: handled: 200 (audit=true, bar=baz, latency=15)
  470. GET /foo
  471. ...
  472. - *Exit* CLI on EPIPE, otherwise we sit there useless processing a huge log
  473. file with, e.g. `bunyan huge.log | head`.
  474. ## 0.16.8
  475. - Guards on `-c CONDITION` usage to attempt to be more user friendly.
  476. Bogus JS code will result in this:
  477. $ bunyan portal.log -c 'this.req.username==boo@foo'
  478. bunyan: error: illegal CONDITION code: SyntaxError: Unexpected token ILLEGAL
  479. CONDITION script:
  480. Object.prototype.TRACE = 10;
  481. Object.prototype.DEBUG = 20;
  482. Object.prototype.INFO = 30;
  483. Object.prototype.WARN = 40;
  484. Object.prototype.ERROR = 50;
  485. Object.prototype.FATAL = 60;
  486. this.req.username==boo@foo
  487. Error:
  488. SyntaxError: Unexpected token ILLEGAL
  489. at new Script (vm.js:32:12)
  490. at Function.Script.createScript (vm.js:48:10)
  491. at parseArgv (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:465:27)
  492. at main (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1252:16)
  493. at Object.<anonymous> (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1330:3)
  494. at Module._compile (module.js:449:26)
  495. at Object.Module._extensions..js (module.js:467:10)
  496. at Module.load (module.js:356:32)
  497. at Function.Module._load (module.js:312:12)
  498. at Module.runMain (module.js:492:10)
  499. And all CONDITION scripts will be run against a minimal valid Bunyan
  500. log record to ensure they properly guard against undefined values
  501. (at least as much as can reasonably be checked). For example:
  502. $ bunyan portal.log -c 'this.req.username=="bob"'
  503. bunyan: error: CONDITION code cannot safely filter a minimal Bunyan log record
  504. CONDITION script:
  505. Object.prototype.TRACE = 10;
  506. Object.prototype.DEBUG = 20;
  507. Object.prototype.INFO = 30;
  508. Object.prototype.WARN = 40;
  509. Object.prototype.ERROR = 50;
  510. Object.prototype.FATAL = 60;
  511. this.req.username=="bob"
  512. Minimal Bunyan log record:
  513. {
  514. "v": 0,
  515. "level": 30,
  516. "name": "name",
  517. "hostname": "hostname",
  518. "pid": 123,
  519. "time": 1355514346206,
  520. "msg": "msg"
  521. }
  522. Filter error:
  523. TypeError: Cannot read property 'username' of undefined
  524. at bunyan-condition-0:7:9
  525. at Script.Object.keys.forEach.(anonymous function) [as runInNewContext] (vm.js:41:22)
  526. at parseArgv (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:477:18)
  527. at main (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1252:16)
  528. at Object.<anonymous> (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1330:3)
  529. at Module._compile (module.js:449:26)
  530. at Object.Module._extensions..js (module.js:467:10)
  531. at Module.load (module.js:356:32)
  532. at Function.Module._load (module.js:312:12)
  533. at Module.runMain (module.js:492:10)
  534. A proper way to do that condition would be:
  535. $ bunyan portal.log -c 'this.req && this.req.username=="bob"'
  536. ## 0.16.7
  537. - [issue #59] Clear a possibly interrupted ANSI color code on signal
  538. termination.
  539. ## 0.16.6
  540. - [issue #56] Support `bunyan -p NAME` to dtrace all PIDs matching 'NAME' in
  541. their command and args (using `ps -A -o pid,command | grep NAME` or, on SunOS
  542. `pgrep -lf NAME`). E.g.:
  543. bunyan -p myappname
  544. This is useful for usage of node's [cluster
  545. module](http://nodejs.org/docs/latest/api/all.html#all_cluster) where you'll
  546. have multiple worker processes.
  547. ## 0.16.5
  548. - Allow `bunyan -p '*'` to capture bunyan dtrace probes from **all** processes.
  549. - issue #55: Add support for `BUNYAN_NO_COLOR` environment variable to
  550. turn off all output coloring. This is still overridden by the `--color`
  551. and `--no-color` options.
  552. ## 0.16.4
  553. - issue #54: Ensure (again, see 0.16.2) that stderr from the dtrace child
  554. process (when using `bunyan -p PID`) gets through. There had been a race
  555. between exiting bunyan and the flushing of the dtrace process' stderr.
  556. ## 0.16.3
  557. - Drop 'trentm-dtrace-provider' fork dep now that
  558. <https://github.com/chrisa/node-dtrace-provider/pull/24> has been resolved.
  559. Back to dtrace-provider.
  560. ## 0.16.2
  561. - Ensure that stderr from the dtrace child process (when using `bunyan -p PID`)
  562. gets through. The `pipe` usage wasn't working on SmartOS. This is important
  563. to show the user if they need to 'sudo'.
  564. ## 0.16.1
  565. - Ensure that a possible dtrace child process (with using `bunyan -p PID`) is
  566. terminated on signal termination of the bunyan CLI (at least for SIGINT,
  567. SIGQUIT, SIGTERM, SIGHUP).
  568. ## 0.16.0
  569. - Add `bunyan -p PID` support. This is a convenience wrapper that effectively
  570. calls:
  571. dtrace -x strsize=4k -qn 'bunyan$PID:::log-*{printf("%s", copyinstr(arg0))}' | bunyan
  572. ## 0.15.0
  573. - issue #48: Dtrace support! The elevator pitch is you can watch all logging
  574. from all Bunyan-using process with something like this:
  575. dtrace -x strsize=4k -qn 'bunyan*:::log-*{printf("%d: %s: %s", pid, probefunc, copyinstr(arg0))}'
  576. And this can include log levels *below* what the service is actually configured
  577. to log. E.g. if the service is only logging at INFO level and you need to see
  578. DEBUG log messages, with this you can. Obviously this only works on dtrace-y
  579. platforms: Illumos derivatives of SunOS (e.g. SmartOS, OmniOS), Mac, FreeBSD.
  580. Or get the bunyan CLI to render logs nicely:
  581. dtrace -x strsize=4k -qn 'bunyan*:::log-*{printf("%s", copyinstr(arg0))}' | bunyan
  582. See <https://github.com/trentm/node-bunyan#dtrace-support> for details. By
  583. Bryan Cantrill.
  584. ## 0.14.6
  585. - Export `bunyan.safeCycles()`. This may be useful for custom `type == "raw"`
  586. streams that may do JSON stringification of log records themselves. Usage:
  587. var str = JSON.stringify(rec, bunyan.safeCycles());
  588. - [issue #49] Allow a `log.child()` to specify the level of inherited streams.
  589. For example:
  590. # Before
  591. var childLog = log.child({...});
  592. childLog.level('debug');
  593. # After
  594. var childLog = log.child({..., level: 'debug'});
  595. - Improve the Bunyan CLI crash message to make it easier to provide relevant
  596. details in a bug report.
  597. ## 0.14.5
  598. - Fix a bug in the long-stack-trace error serialization added in 0.14.4. The
  599. symptom:
  600. bunyan@0.14.4: .../node_modules/bunyan/lib/bunyan.js:1002
  601. var ret = ex.stack || ex.toString();
  602. ^
  603. TypeError: Cannot read property 'stack' of undefined
  604. at getFullErrorStack (.../node_modules/bunyan/lib/bunyan.js:1002:15)
  605. ...
  606. ## 0.14.4
  607. - **Bad release. Use 0.14.5 instead.**
  608. - Improve error serialization to walk the chain of `.cause()` errors
  609. from the likes of `WError` or `VError` error classes from
  610. [verror](https://github.com/davepacheco/node-verror) and
  611. [restify v2.0](https://github.com/mcavage/node-restify). Example:
  612. [2012-10-11T00:30:21.871Z] ERROR: imgapi/99612 on 0525989e-2086-4270-b960-41dd661ebd7d: my-message
  613. ValidationFailedError: my-message; caused by TypeError: cause-error-message
  614. at Server.apiPing (/opt/smartdc/imgapi/lib/app.js:45:23)
  615. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  616. at Server.setupReq (/opt/smartdc/imgapi/lib/app.js:178:9)
  617. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  618. at Server.parseBody (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/body_parser.js:15:33)
  619. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  620. at Server.parseQueryString (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/query.js:40:25)
  621. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  622. at Server._run (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:579:17)
  623. at Server._handle.log.trace.req (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:480:38)
  624. Caused by: TypeError: cause-error-message
  625. at Server.apiPing (/opt/smartdc/imgapi/lib/app.js:40:25)
  626. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  627. at Server.setupReq (/opt/smartdc/imgapi/lib/app.js:178:9)
  628. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  629. at Server.parseBody (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/body_parser.js:15:33)
  630. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  631. at Server.parseQueryString (/opt/smartdc/imgapi/node_modules/restify/lib/plugins/query.js:40:25)
  632. at next (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:550:50)
  633. at Server._run (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:579:17)
  634. at Server._handle.log.trace.req (/opt/smartdc/imgapi/node_modules/restify/lib/server.js:480:38)
  635. ## 0.14.2
  636. - [issue #45] Fix bunyan CLI (default output mode) to not crash on a 'res'
  637. field that isn't a response object, but a string.
  638. ## 0.14.1
  639. - [issue #44] Fix the default `bunyan` CLI output of a `res.body` that is an
  640. object instead of a string. See issue#38 for the same with `req.body`.
  641. ## 0.14.0
  642. - [pull #41] Safe `JSON.stringify`ing of emitted log records to avoid blowing
  643. up on circular objects (by Isaac Schlueter).
  644. ## 0.13.5
  645. - [issue #39] Fix a bug with `client_req` handling in the default output
  646. of the `bunyan` CLI.
  647. ## 0.13.4
  648. - [issue #38] Fix the default `bunyan` CLI output of a `req.body` that is an
  649. object instead of a string.
  650. ## 0.13.3
  651. - Export `bunyan.resolveLevel(NAME-OR-NUM)` to resolve a level name or number
  652. to its log level number value:
  653. > bunyan.resolveLevel('INFO')
  654. 30
  655. > bunyan.resolveLevel('debug')
  656. 20
  657. A side-effect of this change is that the uppercase level name is now allowed
  658. in the logger constructor.
  659. ## 0.13.2
  660. - [issue #35] Ensure that an accidental `log.info(BUFFER)`, where BUFFER is
  661. a node.js Buffer object, doesn't blow up.
  662. ## 0.13.1
  663. - [issue #34] Ensure `req.body`, `res.body` and other request/response fields
  664. are emitted by the `bunyan` CLI (mostly by Rob Gulewich).
  665. ## 0.13.0
  666. - [issue #31] Re-instate defines for the (uppercase) log level names (TRACE,
  667. DEBUG, etc.) in `bunyan -c "..."` filtering condition code. E.g.:
  668. $ ... | bunyan -c 'level >= ERROR'
  669. ## 0.12.0
  670. - [pull #32] `bunyan -o short` for more concise output (by Dave Pacheco). E.g.:
  671. 22:56:52.856Z INFO myservice: My message
  672. instead of:
  673. [2012-02-08T22:56:52.856Z] INFO: myservice/123 on example.com: My message
  674. ## 0.11.3
  675. - Add '--strict' option to `bunyan` CLI to suppress all but legal Bunyan JSON
  676. log lines. By default non-JSON, and non-Bunyan lines are passed through.
  677. ## 0.11.2
  678. - [issue #30] Robust handling of 'req' field without a 'headers' subfield
  679. in `bunyan` CLI.
  680. - [issue #31] Pull the TRACE, DEBUG, et al defines from `bunyan -c "..."`
  681. filtering code. This was added in v0.11.1, but has a significant adverse
  682. affect.
  683. ## 0.11.1
  684. - **Bad release. The TRACE et al names are bleeding into the log records
  685. when using '-c'.**
  686. - Add defines for the (uppercase) log level names (TRACE, DEBUG, etc.) in
  687. `bunyan -c "..."` filtering condition code. E.g.:
  688. $ ... | bunyan -c 'level >= ERROR'
  689. ## 0.11.0
  690. - [pull #29] Add -l/--level for level filtering, and -c/--condition for
  691. arbitrary conditional filtering (by github.com/isaacs):
  692. $ ... | bunyan -l error # filter out log records below error
  693. $ ... | bunyan -l 50 # numeric value works too
  694. $ ... | bunyan -c 'level===50' # equiv with -c filtering
  695. $ ... | bunyan -c 'pid===123' # filter on any field
  696. $ ... | bunyan -c 'pid===123' -c '_audit' # multiple filters
  697. ## 0.10.0
  698. - [pull #24] Support for gzip'ed log files in the bunyan CLI (by
  699. github.com/mhart):
  700. $ bunyan foo.log.gz
  701. ...
  702. ## 0.9.0
  703. - [pull #16] Bullet proof the `bunyan.stdSerializers` (by github.com/rlidwka).
  704. - [pull #15] The `bunyan` CLI will now chronologically merge multiple log
  705. streams when it is given multiple file arguments. (by github.com/davepacheco)
  706. $ bunyan foo.log bar.log
  707. ... merged log records ...
  708. - [pull #15] A new `bunyan.RingBuffer` stream class that is useful for
  709. keeping the last N log messages in memory. This can be a fast way to keep
  710. recent, and thus hopefully relevant, log messages. (by @dapsays,
  711. github.com/davepacheco)
  712. Potential uses: Live debugging if a running process could inspect those
  713. messages. One could dump recent log messages at a finer log level than is
  714. typically logged on
  715. [`uncaughtException`](http://nodejs.org/docs/latest/api/all.html#all_event_uncaughtexception).
  716. var ringbuffer = new bunyan.RingBuffer({ limit: 100 });
  717. var log = new bunyan({
  718. name: 'foo',
  719. streams: [{
  720. type: 'raw',
  721. stream: ringbuffer,
  722. level: 'debug'
  723. }]
  724. });
  725. log.info('hello world');
  726. console.log(ringbuffer.records);
  727. - Add support for "raw" streams. This is a logging stream that is given
  728. raw log record objects instead of a JSON-stringified string.
  729. function Collector() {
  730. this.records = [];
  731. }
  732. Collector.prototype.write = function (rec) {
  733. this.records.push(rec);
  734. }
  735. var log = new Logger({
  736. name: 'mylog',
  737. streams: [{
  738. type: 'raw',
  739. stream: new Collector()
  740. }]
  741. });
  742. See "examples/raw-stream.js". I expect raw streams to be useful for
  743. piping Bunyan logging to separate services (e.g. <http://www.loggly.com/>,
  744. <https://github.com/etsy/statsd>) or to separate in-process handling.
  745. - Add test/corpus/*.log files (accidentally excluded) so the test suite
  746. actually works(!).
  747. ## 0.8.0
  748. - [pull #21] Bunyan loggers now re-emit `fs.createWriteStream` error events.
  749. By github.com/EvanOxfeld. See "examples/handle-fs-error.js" and
  750. "test/error-event.js" for details.
  751. var log = new Logger({name: 'mylog', streams: [{path: FILENAME}]});
  752. log.on('error', function (err, stream) {
  753. // Handle error writing to or creating FILENAME.
  754. });
  755. - jsstyle'ing (via `make check`)
  756. ## 0.7.0
  757. - [issue #12] Add `bunyan.createLogger(OPTIONS)` form, as is more typical in
  758. node.js APIs. This'll eventually become the preferred form.
  759. ## 0.6.9
  760. - Change `bunyan` CLI default output to color "src" info red. Before the "src"
  761. information was uncolored. The "src" info is the filename, line number and
  762. function name resulting from using `src: true` in `Logger` creation. I.e.,
  763. the `(/Users/trentm/tm/node-bunyan/examples/hi.js:10)` in:
  764. [2012-04-10T22:28:58.237Z] INFO: myapp/39339 on banana.local (/Users/trentm/tm/node-bunyan/examples/hi.js:10): hi
  765. - Tweak `bunyan` CLI default output to still show an "err" field if it doesn't
  766. have a "stack" attribute.
  767. ## 0.6.8
  768. - Fix bad bug in `log.child({...}, true);` where the added child fields **would
  769. be added to the parent's fields**. This bug only existed for the "fast child"
  770. path (that second `true` argument). A side-effect of fixing this is that
  771. the "fast child" path is only 5 times as fast as the regular `log.child`,
  772. instead of 10 times faster.
  773. ## 0.6.7
  774. - [issue #6] Fix bleeding 'type' var to global namespace. (Thanks Mike!)
  775. ## 0.6.6
  776. - Add support to the `bunyan` CLI taking log file path args, `bunyan foo.log`,
  777. in addition to the usual `cat foo.log | bunyan`.
  778. - Improve reliability of the default output formatting of the `bunyan` CLI.
  779. Before it could blow up processing log records missing some expected
  780. fields.
  781. ## 0.6.5
  782. - ANSI coloring output from `bunyan` CLI tool (for the default output mode/style).
  783. Also add the '--color' option to force coloring if the output stream is not
  784. a TTY, e.g. `cat my.log | bunyan --color | less -R`. Use `--no-color` to
  785. disable coloring, e.g. if your terminal doesn't support ANSI codes.
  786. - Add 'level' field to log record before custom fields for that record. This
  787. just means that the raw record JSON will show the 'level' field earlier,
  788. which is a bit nicer for raw reading.
  789. ## 0.6.4
  790. - [issue #5] Fix `log.info() -> boolean` to work properly. Previous all were
  791. returning false. Ditto all trace/debug/.../fatal methods.
  792. ## 0.6.3
  793. - Allow an optional `msg` and arguments to the `log.info(<Error> err)` logging
  794. form. For example, before:
  795. log.debug(my_error_instance) // good
  796. log.debug(my_error_instance, "boom!") // wasn't allowed
  797. Now the latter is allowed if you want to expliciting set the log msg. Of course
  798. this applies to all the `log.{trace|debug|info...}()` methods.
  799. - `bunyan` cli output: clarify extra fields with quoting if empty or have
  800. spaces. E.g. 'cmd' and 'stderr' in the following:
  801. [2012-02-12T00:30:43.736Z] INFO: mo-docs/43194 on banana.local: buildDocs results (req_id=185edca2-2886-43dc-911c-fe41c09ec0f5, route=PutDocset, error=null, stderr="", cmd="make docs")
  802. ## 0.6.2
  803. - Fix/guard against unintended inclusion of some files in npm published package
  804. due to <https://github.com/isaacs/npm/issues/2144>
  805. ## 0.6.1
  806. - Internal: starting jsstyle usage.
  807. - Internal: add .npmignore. Previous packages had reams of bunyan crud in them.
  808. ## 0.6.0
  809. - Add 'pid' automatic log record field.
  810. ## 0.5.3
  811. - Add 'client_req' (HTTP client request) standard formatting in `bunyan` CLI
  812. default output.
  813. - Improve `bunyan` CLI default output to include *all* log record keys. Unknown keys
  814. are either included in the first line parenthetical (if short) or in the indented
  815. subsequent block (if long or multiline).
  816. ## 0.5.2
  817. - [issue #3] More type checking of `new Logger(...)` and `log.child(...)`
  818. options.
  819. - Start a test suite.
  820. ## 0.5.1
  821. - [issue #2] Add guard on `JSON.stringify`ing of log records before emission.
  822. This will prevent `log.info` et al throwing on record fields that cannot be
  823. represented as JSON. An error will be printed on stderr and a clipped log
  824. record emitted with a 'bunyanMsg' key including error details. E.g.:
  825. bunyan: ERROR: could not stringify log record from /Users/trentm/tm/node-bunyan/examples/unstringifyable.js:12: TypeError: Converting circular structure to JSON
  826. {
  827. "name": "foo",
  828. "hostname": "banana.local",
  829. "bunyanMsg": "bunyan: ERROR: could not stringify log record from /Users/trentm/tm/node-bunyan/examples/unstringifyable.js:12: TypeError: Converting circular structure to JSON",
  830. ...
  831. Some timing shows this does effect log speed:
  832. $ node tools/timeguard.js # before
  833. Time try/catch-guard on JSON.stringify:
  834. - log.info: 0.07365ms per iteration
  835. $ node tools/timeguard.js # after
  836. Time try/catch-guard on JSON.stringify:
  837. - log.info: 0.07368ms per iteration
  838. ## 0.5.0
  839. - Use 10/20/... instead of 1/2/... for level constant values. Ostensibly this
  840. allows for intermediary levels from the defined "trace/debug/..." set.
  841. However, that is discouraged. I'd need a strong user argument to add
  842. support for easily using alternative levels. Consider using a separate
  843. JSON field instead.
  844. - s/service/name/ for Logger name field. "service" is unnecessarily tied
  845. to usage for a service. No need to differ from log4j Logger "name".
  846. - Add `log.level(...)` and `log.levels(...)` API for changing logger stream
  847. levels.
  848. - Add `TRACE|DEBUG|INFO|WARN|ERROR|FATAL` level constants to exports.
  849. - Add `log.info(err)` special case for logging an `Error` instance. For
  850. example `log.info(new TypeError("boom")` will produce:
  851. ...
  852. "err": {
  853. "message": "boom",
  854. "name": "TypeError",
  855. "stack": "TypeError: boom\n at Object.<anonymous> ..."
  856. },
  857. "msg": "boom",
  858. ...
  859. ## 0.4.0
  860. - Add `new Logger({src: true})` config option to have a 'src' attribute be
  861. automatically added to log records with the log call source info. Example:
  862. "src": {
  863. "file": "/Users/trentm/tm/node-bunyan/examples/src.js",
  864. "line": 20,
  865. "func": "Wuzzle.woos"
  866. },
  867. ## 0.3.0
  868. - `log.child(options[, simple])` Added `simple` boolean arg. Set `true` to
  869. assert that options only add fields (no config changes). Results in a 10x
  870. speed increase in child creation. See "tools/timechild.js". On my Mac,
  871. "fast child" creation takes about 0.001ms. IOW, if your app is dishing
  872. 10,000 req/s, then creating a log child for each request will take
  873. about 1% of the request time.
  874. - `log.clone` -> `log.child` to better reflect the relationship: streams and
  875. serializers are inherited. Streams can't be removed as part of the child
  876. creation. The child doesn't own the parent's streams (so can't close them).
  877. - Clean up Logger creation. The goal here was to ensure `log.child` usage
  878. is fast. TODO: measure that.
  879. - Add `Logger.stdSerializers.err` serializer which is necessary to get good
  880. Error object logging with node 0.6 (where core Error object properties
  881. are non-enumerable).
  882. ## 0.2.0
  883. - Spec'ing core/recommended log record fields.
  884. - Add `LOG_VERSION` to exports.
  885. - Improvements to request/response serializations.
  886. ## 0.1.0
  887. First release.