Skip to content

logging req, res #27

Description

@CodisRedding

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
  }
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions