Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging req, res #27

Open
CodisRedding opened this issue Oct 29, 2016 · 0 comments
Open

logging req, res #27

CodisRedding opened this issue Oct 29, 2016 · 0 comments

Comments

@CodisRedding
Copy link
Contributor

CodisRedding commented Oct 29, 2016

I'm exploring my options for logging our http requests and responses in our services and thought about the idea of passing a logger to an http client to ensure that their all logged. The idea would be something like below. I realize that it's not the responsibility of the client to do the logging, but if I kind of like the idea of passing a logger in t to the bidding for me.

I know Bunyan has serializers for req's and res's to help handle this.
https://www.npmjs.com/package/bunyan#recommendedbest-practice-fields

const bhttp = require('bhttp')({
  logger: myLogger
});

or

// default would be true for post, get, etc...
const bhttp = require('bhttp')({
  logging: {
    logger: myLogger,
    post: false,
    delete: false
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant