node-bunyan-lite/CHANGES.md

307 lines
10 KiB
Markdown
Raw Normal View History

2012-02-02 17:11:45 +00:00
# bunyan Changelog
2012-08-08 18:58:43 +00:00
## bunyan 0.11.2 (not yet released)
(nothing yet)
2012-08-08 18:58:02 +00:00
## bunyan 0.11.1
2012-08-08 05:36:42 +00:00
- Add defines for the (uppercase) log level names (TRACE, DEBUG, etc.) in
`bunyan -c "..."` filtering condition code. E.g.:
$ ... | bunyan -c 'level >= ERROR'
2012-08-08 05:36:42 +00:00
2012-08-08 05:35:38 +00:00
## bunyan 0.11.0
2012-06-22 05:49:24 +00:00
- [pull #29] Add -l/--level for level filtering, and -c/--condition for
arbitrary conditional filtering (by github.com/isaacs):
$ ... | bunyan -l error # filter out log records below error
$ ... | bunyan -l 50 # numeric value works too
$ ... | bunyan -c 'level===50' # equiv with -c filtering
$ ... | bunyan -c 'pid===123' # filter on any field
$ ... | bunyan -c 'pid===123' -c '_audit' # multiple filters
2012-06-22 05:49:24 +00:00
2012-06-22 05:49:13 +00:00
## bunyan 0.10.0
2012-06-22 03:06:10 +00:00
- [pull #24] Support for gzip'ed log files in the bunyan CLI (by
github.com/mhart):
$ bunyan foo.log.gz
...
2012-06-22 03:06:10 +00:00
2012-06-22 03:05:57 +00:00
## bunyan 0.9.0
2012-06-20 23:04:23 +00:00
- [pull #16] Bullet proof the `bunyan.stdSerializers` (by github.com/rlidwka).
2012-06-21 00:02:43 +00:00
- [pull #15] The `bunyan` CLI will now chronologically merge multiple log
streams when it is given multiple file arguments. (by github.com/davepacheco)
$ bunyan foo.log bar.log
... merged log records ...
- [pull #15] A new `bunyan.RingBuffer` stream class that is useful for
keeping the last N log messages in memory. This can be a fast way to keep
recent, and thus hopefully relevant, log messages. (by @dapsays,
github.com/davepacheco)
Potential uses: Live debugging if a running process could inspect those
messages. One could dump recent log messages at a finer log level than is
typically logged on
2012-06-21 00:02:43 +00:00
[`uncaughtException`](http://nodejs.org/docs/latest/api/all.html#all_event_uncaughtexception).
var ringbuffer = new bunyan.RingBuffer({ limit: 100 });
var log = new bunyan({
name: 'foo',
streams: [{
type: 'raw',
stream: ringbuffer,
level: 'debug'
}]
2012-06-21 00:02:43 +00:00
});
log.info('hello world');
console.log(ringbuffer.records);
2012-06-21 00:02:43 +00:00
2012-06-20 23:04:23 +00:00
- Add support for "raw" streams. This is a logging stream that is given
raw log record objects instead of a JSON-stringified string.
function Collector() {
this.records = [];
}
Collector.prototype.write = function (rec) {
this.records.push(rec);
}
var log = new Logger({
name: 'mylog',
streams: [{
type: 'raw',
stream: new Collector()
}]
2012-06-20 23:04:23 +00:00
});
2012-06-21 00:02:43 +00:00
See "examples/raw-stream.js". I expect raw streams to be useful for
piping Bunyan logging to separate services (e.g. <http://www.loggly.com/>,
2012-06-21 00:02:43 +00:00
<https://github.com/etsy/statsd>) or to separate in-process handling.
2012-06-05 06:31:10 +00:00
- Add test/corpus/*.log files (accidentally excluded) so the test suite
actually works(!).
2012-06-05 06:31:10 +00:00
2012-06-05 06:30:58 +00:00
## bunyan 0.8.0
- [pull #21] Bunyan loggers now re-emit `fs.createWriteStream` error events.
By github.com/EvanOxfeld. See "examples/handle-fs-error.js" and
"test/error-event.js" for details.
var log = new Logger({name: 'mylog', streams: [{path: FILENAME}]});
log.on('error', function (err, stream) {
// Handle error writing to or creating FILENAME.
});
2012-04-27 23:21:23 +00:00
2012-04-28 08:01:54 +00:00
- jsstyle'ing (via `make check`)
2012-04-27 23:21:23 +00:00
2012-04-27 23:21:15 +00:00
## bunyan 0.7.0
2012-04-27 23:16:31 +00:00
- [issue #12] Add `bunyan.createLogger(OPTIONS)` form, as is more typical in
node.js APIs. This'll eventually become the preferred form.
2012-04-27 23:16:31 +00:00
2012-04-27 23:16:13 +00:00
## bunyan 0.6.9
2012-02-28 00:48:22 +00:00
- Change `bunyan` CLI default output to color "src" info red. Before the "src"
information was uncolored. The "src" info is the filename, line number and
function name resulting from using `src: true` in `Logger` creation. I.e.,
the `(/Users/trentm/tm/node-bunyan/examples/hi.js:10)` in:
[2012-04-10T22:28:58.237Z] INFO: myapp/39339 on banana.local (/Users/trentm/tm/node-bunyan/examples/hi.js:10): hi
- Tweak `bunyan` CLI default output to still show an "err" field if it doesn't
have a "stack" attribute.
2012-02-28 00:48:22 +00:00
2012-02-28 00:48:12 +00:00
## bunyan 0.6.8
2012-02-24 20:20:05 +00:00
- Fix bad bug in `log.child({...}, true);` where the added child fields **would
be added to the parent's fields**. This bug only existed for the "fast child"
path (that second `true` argument). A side-effect of fixing this is that
the "fast child" path is only 5 times as fast as the regular `log.child`,
instead of 10 times faster.
2012-02-24 20:20:05 +00:00
2012-02-24 20:19:53 +00:00
## bunyan 0.6.7
2012-02-24 05:20:58 +00:00
2012-02-24 20:19:29 +00:00
- [issue #6] Fix bleeding 'type' var to global namespace. (Thanks Mike!)
2012-02-24 05:20:58 +00:00
2012-02-24 05:20:45 +00:00
## bunyan 0.6.6
2012-02-23 21:01:23 +00:00
2012-02-24 05:19:28 +00:00
- Add support to the `bunyan` CLI taking log file path args, `bunyan foo.log`,
in addition to the usual `cat foo.log | bunyan`.
- Improve reliability of the default output formatting of the `bunyan` CLI.
Before it could blow up processing log records missing some expected
fields.
2012-02-23 21:01:23 +00:00
2012-02-23 21:01:12 +00:00
## bunyan 0.6.5
2012-02-20 05:42:58 +00:00
- ANSI coloring output from `bunyan` CLI tool (for the default output mode/style).
Also add the '--color' option to force coloring if the output stream is not
2012-02-23 21:00:53 +00:00
a TTY, e.g. `cat my.log | bunyan --color | less -R`. Use `--no-color` to
disable coloring, e.g. if your terminal doesn't support ANSI codes.
- Add 'level' field to log record before custom fields for that record. This
just means that the raw record JSON will show the 'level' field earlier,
which is a bit nicer for raw reading.
2012-02-22 18:53:12 +00:00
2012-02-20 05:42:58 +00:00
2012-02-20 05:42:47 +00:00
## bunyan 0.6.4
- [issue #5] Fix `log.info() -> boolean` to work properly. Previous all were
returning false. Ditto all trace/debug/.../fatal methods.
2012-02-17 00:53:13 +00:00
## bunyan 0.6.3
2012-02-11 05:52:12 +00:00
- Allow an optional `msg` and arguments to the `log.info(<Error> err)` logging
form. For example, before:
log.debug(my_error_instance) // good
log.debug(my_error_instance, "boom!") // wasn't allowed
Now the latter is allowed if you want to expliciting set the log msg. Of course
this applies to all the `log.{trace|debug|info...}()` methods.
- `bunyan` cli output: clarify extra fields with quoting if empty or have
spaces. E.g. 'cmd' and 'stderr' in the following:
[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")
2012-02-11 05:52:12 +00:00
2012-02-11 05:51:59 +00:00
## bunyan 0.6.2
2012-02-10 08:16:59 +00:00
2012-02-11 05:51:38 +00:00
- Fix/guard against unintended inclusion of some files in npm published package
due to <https://github.com/isaacs/npm/issues/2144>
2012-02-10 08:16:59 +00:00
2012-02-10 08:16:11 +00:00
## bunyan 0.6.1
2012-02-10 05:11:27 +00:00
- Internal: starting jsstyle usage.
- Internal: add .npmignore. Previous packages had reams of bunyan crud in them.
2012-02-10 05:11:27 +00:00
2012-02-10 05:10:26 +00:00
## bunyan 0.6.0
- Add 'pid' automatic log record field.
2012-02-08 23:28:19 +00:00
2012-02-08 23:28:05 +00:00
## bunyan 0.5.3
2012-02-08 18:30:38 +00:00
2012-02-08 23:27:53 +00:00
- Add 'client_req' (HTTP client request) standard formatting in `bunyan` CLI
default output.
2012-02-08 23:18:07 +00:00
- Improve `bunyan` CLI default output to include *all* log record keys. Unknown keys
are either included in the first line parenthetical (if short) or in the indented
subsequent block (if long or multiline).
2012-02-08 18:30:38 +00:00
2012-02-08 18:30:24 +00:00
## bunyan 0.5.2
2012-02-07 05:35:39 +00:00
- [issue #3] More type checking of `new Logger(...)` and `log.child(...)`
options.
2012-02-08 18:05:56 +00:00
- Start a test suite.
2012-02-07 05:35:39 +00:00
2012-02-07 05:35:29 +00:00
## bunyan 0.5.1
2012-02-06 23:27:50 +00:00
2012-02-07 05:35:19 +00:00
- [issue #2] Add guard on `JSON.stringify`ing of log records before emission.
This will prevent `log.info` et al throwing on record fields that cannot be
represented as JSON. An error will be printed on stderr and a clipped log
record emitted with a 'bunyanMsg' key including error details. E.g.:
2012-02-23 21:00:53 +00:00
bunyan: ERROR: could not stringify log record from /Users/trentm/tm/node-bunyan/examples/unstringifyable.js:12: TypeError: Converting circular structure to JSON
{
"name": "foo",
"hostname": "banana.local",
"bunyanMsg": "bunyan: ERROR: could not stringify log record from /Users/trentm/tm/node-bunyan/examples/unstringifyable.js:12: TypeError: Converting circular structure to JSON",
...
2012-02-23 21:00:53 +00:00
Some timing shows this does effect log speed:
$ node tools/timeguard.js # before
Time try/catch-guard on JSON.stringify:
- log.info: 0.07365ms per iteration
$ node tools/timeguard.js # after
Time try/catch-guard on JSON.stringify:
- log.info: 0.07368ms per iteration
2012-02-07 05:35:19 +00:00
2012-02-06 23:27:50 +00:00
2012-02-06 23:27:42 +00:00
## bunyan 0.5.0
2012-02-06 17:10:11 +00:00
- Use 10/20/... instead of 1/2/... for level constant values. Ostensibly this
allows for intermediary levels from the defined "trace/debug/..." set.
However, that is discouraged. I'd need a strong user argument to add
support for easily using alternative levels. Consider using a separate
JSON field instead.
- s/service/name/ for Logger name field. "service" is unnecessarily tied
to usage for a service. No need to differ from log4j Logger "name".
- Add `log.level(...)` and `log.levels(...)` API for changing logger stream
levels.
- Add `TRACE|DEBUG|INFO|WARN|ERROR|FATAL` level constants to exports.
2012-02-06 17:10:11 +00:00
- Add `log.info(err)` special case for logging an `Error` instance. For
example `log.info(new TypeError("boom")` will produce:
...
"err": {
"message": "boom",
"name": "TypeError",
"stack": "TypeError: boom\n at Object.<anonymous> ..."
},
"msg": "boom",
...
2012-02-06 04:34:40 +00:00
2012-02-06 04:34:08 +00:00
## bunyan 0.4.0
- Add `new Logger({src: true})` config option to have a 'src' attribute be
automatically added to log records with the log call source info. Example:
"src": {
"file": "/Users/trentm/tm/node-bunyan/examples/src.js",
"line": 20,
"func": "Wuzzle.woos"
},
2012-02-05 05:43:06 +00:00
2012-02-05 05:42:55 +00:00
## bunyan 0.3.0
- `log.child(options[, simple])` Added `simple` boolean arg. Set `true` to
assert that options only add fields (no config changes). Results in a 10x
2012-02-23 21:00:53 +00:00
speed increase in child creation. See "tools/timechild.js". On my Mac,
"fast child" creation takes about 0.001ms. IOW, if your app is dishing
10,000 req/s, then creating a log child for each request will take
about 1% of the request time.
- `log.clone` -> `log.child` to better reflect the relationship: streams and
serializers are inherited. Streams can't be removed as part of the child
creation. The child doesn't own the parent's streams (so can't close them).
- Clean up Logger creation. The goal here was to ensure `log.child` usage
is fast. TODO: measure that.
- Add `Logger.stdSerializers.err` serializer which is necessary to get good
Error object logging with node 0.6 (where core Error object properties
are non-enumerable).
2012-02-04 01:05:31 +00:00
2012-02-04 01:05:22 +00:00
## bunyan 0.2.0
2012-02-02 23:16:28 +00:00
- Spec'ing core/recommended log record fields.
- Add `LOG_VERSION` to exports.
- Improvements to request/response serializations.
2012-02-02 23:16:28 +00:00
2012-02-02 22:59:52 +00:00
## bunyan 0.1.0
2012-02-02 17:11:45 +00:00
First release.