Skip to content
Snippets Groups Projects
Commit 8e95d845 authored by michael.minelli's avatar michael.minelli
Browse files

Create a middleware based on morgan library and that use the shared logger

parent 89dd8610
No related branches found
No related tags found
No related merge requests found
import morgan, { StreamOptions } from 'morgan';
import logger from '../shared/logging/WinstonLogger';
const stream: StreamOptions = {
write: (message) => logger.http(message)
};
const skip = () => {
return false; //SharedConfig.production;
};
const morganMiddleware = morgan(':method :url :status :res[content-length] - :response-time ms', {
stream,
skip
});
export default morganMiddleware;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment