Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trentm/node-bunyan
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 49891f480d2532f0f559477573ead232977436e2
Choose a base ref
...
head repository: trentm/node-bunyan
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ea21d75f548373f29bb772b15faeb83e87089746
Choose a head ref
Loading
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,4 @@
*.log
!/test/corpus/*.log
/*.tgz
/test/*.log.0
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: node_js

os:
- linux
- osx

env:
- SKIP_DTRACE=1

node_js:
- '0.10'
- '0.12'
- '4'
- '5'
- '6'
- 'node'


# Gives us faster boot time, see https://docs.travis-ci.com/user/ci-environment/
sudo: false

script:
- npm test
21 changes: 18 additions & 3 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Trent Mick <trentm@gmail.com> (http://trentm.com)
Mark Cavage <mcavage@gmail.com> (https://github.com/mcavage)
Dave Pacheco <dap@joyent.com> (https://github.com/davepacheco)
Trent Mick (http://trentm.com)
Mark Cavage (https://github.com/mcavage)
Dave Pacheco (https://github.com/davepacheco)
Michael Hart (https://github.com/mhart)
Isaac Schlueter (https://github.com/isaacs)
Rob Gulewich (https://github.com/rgulewich)
@@ -25,3 +25,18 @@ Shakeel Mohamed (https://github.com/shakeelmohamed)
Denis Izmaylov (https://github.com/DenisIzmaylov)
Guillermo Grau Panea (https://github.com/guigrpa)
Mark LeMerise (https://github.com/MarkLeMerise)
https://github.com/sometimesalready
Charly Koza (https://github.com/Cactusbone)
Thomas Heymann (https://github.com/cyberthom)
David M. Lee (https://github.com/leedm777)
Marc Udoff (https://github.com/mlucool)
Mark Stosberg (https://github.com/markstos)
Alexander Ray (https://github.com/aray12)
Adam Lynch (https://github.com/adam-lynch)
Michael Nisi (https://github.com/michaelnisi)
Martijn Schrage (https://github.com/Oblosys)
Paul Milham (https://github.com/domrein)
Frankie O'Rourke (https://github.com/psfrankie)
Cody Mello (https://github.com/melloc)
Todd Whiteman (https://github.com/twhiteman)
Zach Bjornson (https://github.com/zbjornson)
194 changes: 194 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,200 @@ Known issues:
- [issue #58] Can't install to a dir with spaces. This is [this node-gyp
bug](https://github.com/TooTallNate/node-gyp/issues/65).

## not yet released

(nothing yet)


## 1.8.13

- Fix a vulnerability from a crafted argument to 'bunyan -p ARG'

This was reported privately as:
https://hackerone.com/reports/902739
bunyan - RCE via insecure command formatting

Previous to this version the 'bunyan' CLI was not escaping a given argument
to the '-p' option before executing `ps -A -o pid,command | grep '$ARG'`
which could lead to unintended execution.

## 1.8.12

- [issue #444] Fix the `bunyan` CLI to not duplicate the "HTTP/1.1 ..." status
line when serializing a "res" field.


## 1.8.11

- [issue #504] The `bunyan` 1.x CLI adds a `Host: $client_req.address[:$client_req.port]`
header when rendering a `client_req` field in a log record. Fix that here to:
(a) not add it if `client_req.headers` already includes a host header; and
(b) not include the given `port` if it is 80 or 443 (*assuming* that is the
default port.
Note: `bunyan` 2.x CLI will stop adding this Host header because it is a guess
that can be wrong and misleading.


## 1.8.10

- Ensure that `bunyan` errors out if attempting to use `-p PID` and
file args at the same time.


## 1.8.9

- [pull #409, issue #246] Revert a change added to the `bunyan` CLI version
1.0.1 where `SIGINT` was ignored, such that Ctrl+C could not be used to
terminate bunyan. (By @zbjornson and @davepacheco.)
- [pull #469] Fix a strict mode (`"use strict;"`) error in some versions of
Safari.


## 1.8.8

- Fix breakage due to a silly last minute "fix 'make check'".


## 1.8.7

Note: *Bad release.* Use 1.8.8 or later.

- [issue #484] Fix breakage due to #474 in previous release.


## 1.8.6

Note: *Bad release.* Use 1.8.7 or later.

- [issue #474] Bunyan's `safeCycles` is too slow when logging large objects.


## 1.8.5

- [issue #401] Improved performance when using disabled log levels.


## 1.8.4

- [issue #454] Fix `src` usage with node v7.


## 1.8.3

- [issue #450] Fix `log.info(null)` crash that resulted from #426 in v1.8.2.


## 1.8.2

- [issue #449] Bump dtrace-provider dep to 0.7.0 to help avoid deprecation
warnings with node v6 in some cases.
- [issue #426] Ensure `log.info({err: err})` results in a "msg" value, just
like `log.info(err)`.


## 1.8.1

- [pull #386] Fix bad bug in rotation that could cause a crash with
error message "cannot start a rotation when already rotating"
(by Frankie O'Rourke). The bug was introduced in 1.8.0.


## 1.8.0

Note: *Bad release.* An addition in this release broke 'rotating-file' usage.
Use 1.8.1 or later.

- [issue #370] Fix `bunyan -p ...` (i.e. DTrace integration) on node
4.x and 5.x.
- [issue #329, pull #330] Update the 'rotating-file' stream to do a file
rotation on initialization if the mtime on the file path indicates the
last rotation time was missed -- i.e. if the app wasn't running at the
time. (by Paul Milham.)


## 1.7.1

- [issue #332, pull #355] Ensure stream for type='stream' stream is a writable
stream. (By Michael Nisi.)

- [issue #344] Fix "rotating-file" Bunyan streams to not miss rotations when configured
for a period greater than approximately 25 days. Before this there was an issue
where periods greater than node.js's maximum `setTimeout` length would fail to rotate.
(By Martijn Schrage.)

- [issue #234, pull #345] Improve `bunyan` CLI rendering of "res" field
HTTP responses to not show two blank lines for an empty body.
(By Michael Nisi.)


## 1.7.0

- [pull #311, #302, #310] Improve the runtime environment detection to fix
running under [NW.js](http://nwjs.io/). Contributions by Adam Lynch, Jeremy
Ruppel, and Aleksey Timchenko.

- [pull #318] Add `reemitErrorEvents` optional boolean for streams added to a
Bunyan logger to control whether an "error" event on the stream will be
re-emitted on the `Logger` instance.

var log = bunyan.createLogger({
name: 'foo',
streams: [
{
type: 'raw',
stream: new MyCustomStream(),
reemitErrorEvents: true
}
]
});

Before this change, "error" events were re-emitted on [`file`
streams](https://github.com/trentm/node-bunyan#stream-type-file) only. The new
behaviour is as follows:

- `reemitErrorEvents` not specified: `file` streams will re-emit error events
on the Logger instance.
- `reemitErrorEvents: true`: error events will be re-emitted on the Logger
for any stream with a `.on()` function -- which includes file streams,
process.stdout/stderr, and any object that inherits from EventEmitter.
- `reemitErrorEvents: false`: error events will not be re-emitted for any
streams.

Dev Note: Bunyan `Logger` objects don't currently have a `.close()` method
in which registered error event handlers can be *un*registered. That means
that a (presumably rare) situation where code adds dozens of Bunyan Logger
streams to, e.g. process.stdout, and with `reemitErrorEvents: true`, could
result in leaking Logger objects.

Original work for allowing "error" re-emitting on non-file streams is
by Marc Udoff in pull #318.


## 1.6.0

- [pull #304, issue #245] Use [Moment.js][momentjs.com] library to handle
`bunyan` CLI time formatting in some cases, especially to fix display of
local time. It is now required for local time formatting (i.e. `bunyan -L`
or `bunyan --time local`). (By David M. Lee.)

- [pull #252] Fix errant `client_res={}` in `bunyan` CLI rendering, and avoid
extra newlines in `client_req` rendering in some cases. (By Thomas Heymann.)

- [pull #291, issue #303] Fix `LOG.child(...)` to *not* override the "hostname"
field of the parent. A use case is when one manually sets "hostname" to
something other than `os.hostname()`. (By github.com/Cactusbone.)

- [issue #325] Allow one to set `level: 0` in `createLogger` to turn on
logging for all levels. (Adapted from #336 by github.com/sometimesalready.)

- Add guards (to `resolveLevel`) so that all "level" values are validated.
Before this, a bogus level like "foo" or -12 or `['some', 'array']` would
silently be accepted -- with undefined results.

- Doc updates for #340 and #305.

- Update `make test` to test against node 5, 4, 0.12 and 0.10.


## 1.5.1

Loading