a fork of express-bunyan-logger

Usage no npm install needed!

<script type="module">
  import expressBunyanLogger2 from '';



Fork of express-bunyan-logger, credit for express-bunyan-logger

Added Option

color [Boolean|Object]

default: false

default color scheme:

    'remote-address': 'white',
    'user-agent': 'yellow',
    'status-code': 'cyan',
    'response-time': 'green',
    'short-body': 'gray',
    'body': 'gray'

Value of color scheme object can be a function, and the value of meta[property] will be passed in to the function. Like,

    'response-time': function(resTime){
        //'resTime' is equal to 'meta['response-time']'
        return resTime < 200 ? 'green': 'red';

excludes [String|[String]]

default: []

The final meta properies will be computed according to the value of excludes.

Default meta properties are:


If you don't want some properties to be logged, just include their names in the excludes option.

Put ! before the name if you do want include the property. Useful when '*' is passed in, and you still want several of them to be included.