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

[[FEAT]] Use req.logger with Loggable Errors #20

Merged
merged 2 commits into from
Jul 5, 2019
Merged

Conversation

jmendiara
Copy link
Member

Add support for the missing pattern that allows having per-request logger

const express = require('express');
const Therror = require('therror');
const therrorConnect = require('therror-connect');
const logger = require('logops');

const app = express();

app.use((req, res, next) => {
  req.logger = logger.child({
    corr: 'some_string`
  });
  next();
});

app.use(therrorConnect());

@jmendiara jmendiara merged commit fe2d451 into master Jul 5, 2019
@jmendiara jmendiara deleted the feat/requestLogger branch July 5, 2019 13:36
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

Successfully merging this pull request may close these issues.

None yet

1 participant