All Versions
110
Latest Version
Avg Release Cycle
22 days
Latest Release
-

Changelog History
Page 7

  • v0.17.0 Changes

    • ๐ŸŒฒ [issue #33] Log rotation support:

      var bunyan = require('bunyan');
      var log = bunyan.createLogger({
          name: 'myapp',
          streams: [{
              type: 'rotating-file',
              path: '/var/log/myapp.log',
              count: 7,
              period: 'daily'
          }]
      });
      
    • ๐Ÿšค Tweak to CLI default pretty output: don't special case "latency" field. The special casing was perhaps nice, but less self-explanatory. Before:

      [2012-12-27T21:17:38.218Z]  INFO: audit/45769 on myserver: handled: 200 (15ms, audit=true, bar=baz)
        GET /foo
        ...
      

    After:

        [2012-12-27T21:17:38.218Z]  INFO: audit/45769 on myserver: handled: 200 (audit=true, bar=baz, latency=15)
          GET /foo
          ...
    
    • Exit CLI on EPIPE, otherwise we sit there useless processing a huge log file with, e.g. bunyan huge.log | head.
  • v0.16.8 Changes

    • Guards on -c CONDITION usage to attempt to be more user friendly. Bogus JS code will result in this:

      $ bunyan portal.log -c '[email protected]'
      bunyan: error: illegal CONDITION code: SyntaxError: Unexpected token ILLEGAL
        CONDITION script:
          Object.prototype.TRACE = 10;
          Object.prototype.DEBUG = 20;
          Object.prototype.INFO = 30;
          Object.prototype.WARN = 40;
          Object.prototype.ERROR = 50;
          Object.prototype.FATAL = 60;
          [email protected]
        Error:
          SyntaxError: Unexpected token ILLEGAL
              at new Script (vm.js:32:12)
              at Function.Script.createScript (vm.js:48:10)
              at parseArgv (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:465:27)
              at main (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1252:16)
              at Object.<anonymous> (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1330:3)
              at Module._compile (module.js:449:26)
              at Object.Module._extensions..js (module.js:467:10)
              at Module.load (module.js:356:32)
              at Function.Module._load (module.js:312:12)
              at Module.runMain (module.js:492:10)
      

    And all CONDITION scripts will be run against a minimal valid Bunyan log record to ensure they properly guard against undefined values (at least as much as can reasonably be checked). For example:

        $ bunyan portal.log -c 'this.req.username=="bob"'
        bunyan: error: CONDITION code cannot safely filter a minimal Bunyan log record
          CONDITION script:
            Object.prototype.TRACE = 10;
            Object.prototype.DEBUG = 20;
            Object.prototype.INFO = 30;
            Object.prototype.WARN = 40;
            Object.prototype.ERROR = 50;
            Object.prototype.FATAL = 60;
            this.req.username=="bob"
          Minimal Bunyan log record:
            {
              "v": 0,
              "level": 30,
              "name": "name",
              "hostname": "hostname",
              "pid": 123,
              "time": 1355514346206,
              "msg": "msg"
            }
          Filter error:
            TypeError: Cannot read property 'username' of undefined
                at bunyan-condition-0:7:9
                at Script.Object.keys.forEach.(anonymous function) [as runInNewContext] (vm.js:41:22)
                at parseArgv (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:477:18)
                at main (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1252:16)
                at Object.<anonymous> (/Users/trentm/tm/node-bunyan-0.x/bin/bunyan:1330:3)
                at Module._compile (module.js:449:26)
                at Object.Module._extensions..js (module.js:467:10)
                at Module.load (module.js:356:32)
                at Function.Module._load (module.js:312:12)
                at Module.runMain (module.js:492:10)
    

    A proper way to do that condition would be:

        $ bunyan portal.log -c 'this.req && this.req.username=="bob"'
    
  • v0.16.7 Changes

    • ๐Ÿšฆ [issue #59] Clear a possibly interrupted ANSI color code on signal termination.
  • v0.16.6 Changes

    • ๐Ÿ‘ [issue #56] Support bunyan -p NAME to dtrace all PIDs matching 'NAME' in their command and args (using ps -A -o pid,command | grep NAME or, on SunOS pgrep -lf NAME). E.g.:

      bunyan -p myappname
      

    This is useful for usage of node's cluster module where you'll have multiple worker processes.

  • v0.16.5 Changes

    • Allow bunyan -p '*' to capture bunyan dtrace probes from all processes.
    • issue #55: Add support for BUNYAN_NO_COLOR environment variable to turn off all output coloring. This is still overridden by the --color and --no-color options.
  • v0.16.4 Changes

    • ๐Ÿ‘€ issue #54: Ensure (again, see 0.16.2) that stderr from the dtrace child process (when using bunyan -p PID) gets through. There had been a race between exiting bunyan and the flushing of the dtrace process' stderr.
  • v0.16.3 Changes

  • v0.16.2 Changes

    • Ensure that stderr from the dtrace child process (when using bunyan -p PID) gets through. The pipe usage wasn't working on SmartOS. This is important to show the user if they need to 'sudo'.
  • v0.16.1 Changes

    • Ensure that a possible dtrace child process (with using bunyan -p PID) is terminated on signal termination of the bunyan CLI (at least for SIGINT, SIGQUIT, SIGTERM, SIGHUP).
  • v0.16.0 Changes

    • โž• Add bunyan -p PID support. This is a convenience wrapper that effectively calls:

      dtrace -x strsize=4k -qn 'bunyan$PID:::log-*{printf("%s", copyinstr(arg0))}' | bunyan