Snai3i-LandingPage-FormBuilder / backend / src / middlewares / loggerMiddleware.ts
loggerMiddleware.ts
Raw
import { Request, Response, NextFunction } from 'express';
import Logger from '../utils/logger';

const loggerMiddleware = (req: Request, res: Response, next: NextFunction) => {
    Logger.info(`Incoming request => Methode: [${req.method.toUpperCase()}] - Url: [${req.path.toUpperCase()}] - IP: [${req.socket.remoteAddress}]`);
    next();
};

export default loggerMiddleware;