bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
797 stars 187 forks source link

Add skip option to error logging #147

Closed ahnkee closed 5 years ago

ahnkee commented 7 years ago

Adds skip option to error logging, like the one that exists for info logging.

bmatson commented 6 years ago

Any progress on getting this merged? I need this functionality too.

bithavoc commented 6 years ago

@rosston ☝️ :)

bithavoc commented 6 years ago

@ahnkee can you take care of the feedback so @rosston we can merge this in? Thanks

ahnkee commented 6 years ago

Sorry about that guys... I completely forgot this was up. Will finish right now

bmatson commented 6 years ago

Any progress on getting this merged and a new release cut? Been waiting on this for a while....

priedthirdeye commented 6 years ago

+1

gianpaj commented 6 years ago

Hi,

Could we revisit this PR?

My use case is to log error messages only if I didn't expect it when testing (TDD). I would send a particular parameter in the request to skip logging an error message when I expect a certain request to generate one (non-authorized, etc.)

Thanks

rclmenezes commented 5 years ago

So.... @rosston can we merge this one in?

rclmenezes commented 5 years ago

For anyone who needs a work around:

server.use((error: any, req: Request, res: Response, next: NextFunction) => {
    if (!<INSERT YOUR SKIP CONDITION HERE>) {
      errorLogger(error, req, res, next);
    }
  })
rosston commented 5 years ago

I took my blocking review away. I'll leave it up to @bithavoc or others to determine if/when to merge it. I'm not doing much maintenance on express-winston anymore.

bithavoc commented 5 years ago

Hi there, I'll review again once the conflicts are fixed :v:

ahnkee commented 5 years ago

Sorry I haven't taken a look at this in a really long time. I'll resolve the conflicts tonight

bithavoc commented 5 years ago

Cool looking forward to it @ahnkee 💪

ahnkee commented 5 years ago

@bithavoc I opened a new PR with the changes: https://github.com/bithavoc/express-winston/pull/214

Couple of things --

bithavoc commented 5 years ago

Thanks @ahnkee Published express-winston@3.2.1 https://github.com/bithavoc/express-winston/releases/tag/v3.2.1