Skip to content
This repository has been archived by the owner on Mar 5, 2018. It is now read-only.

Added excludeEvents option, sometimes some hapi events could be too nois... #8

Closed
wants to merge 3 commits into from

Conversation

gansbrest
Copy link

Added excludeEvents option. Sometimes you may want to exclude some Hapi events from logging to reduce noise level. Wouldn't hurt to have this option.

@joyrexus joyrexus mentioned this pull request May 26, 2016
@ebramanti
Copy link

@silas Can this be merged? Definite 👍 to this change

@jcollum
Copy link

jcollum commented Mar 22, 2017

Yes this absolutely needs to be merged. I've asked in /hapijs/discuss about ignoring logging for some routes and they said I'd have to deal with that in logging. So getting this merged in should be a priority. We have a /health route that is hit (and logged) every 1s. That makes "debug" level logging essentially worthless for me on my prod box.

@silas
Copy link
Owner

silas commented Mar 23, 2017

This is already supported via the handler option.

var config = {
  register: require('hapi-bunyan'),
  options: {
    logger: bunyan.createLogger({ name: 'test', level: 'debug' }),
    handler: function(type) {
      // handled by me, don't log
      if (type === 'request-internal') return true;
    },
  },
};

@silas silas closed this Mar 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants