hapijs / good

hapi process monitoring
Other
525 stars 161 forks source link

Question: Problem with filtering events #606

Closed opravil-jan closed 5 years ago

opravil-jan commented 5 years ago

Hello,

is it possible to filter reporter to accept only defined events. In old version we used "-" to disable unwanted event, but in current version this does not work. Is it possible to disable/avoid some events to be processed? I tried these configurations to avoid event ops but non of these worked.

reporters: { console: [ { module: 'good-squeeze', name: 'Squeeze', args: [{ response: '*', log: '*', error: '*', request: '*' }, { transform }] }, 'stdout' ] } reporters: { console: [ { module: 'good-squeeze', name: 'Squeeze', args: [{ response: '*', log: '*', error: '*', request: '*', ops: '-' }, { transform }] }, 'stdout' ] }

Thank you Jan Opravil

mpeperos commented 5 years ago

Just remove events that you want to disable from args. If you need to filter out ops event:

reporters: {
     myConsoleReporter: [{
         module: 'good-squeeze',
         name: 'Squeeze',
         args: [{ log: '*', response: '*' }]
      }, {
         module: 'good-console'
      },
      'stdout']
}
opravil-jan commented 5 years ago

I found solution. right solution is to use


 if (!Squeeze.filter(this._subscription, data)) {
    return callback(null)
  }
lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.