mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			369 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			369 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
'use strict';
 | 
						|
 | 
						|
const url = require('url');
 | 
						|
const logger = require('../logger')('HTTP');
 | 
						|
 | 
						|
module.exports = function(config) {
 | 
						|
    return (req, res, next) => {
 | 
						|
        next();
 | 
						|
        if (config.enableRequestLogger) {
 | 
						|
            const { pathname } = url.parse(req.originalUrl);
 | 
						|
            logger.info(`${res.statusCode} ${req.method} ${pathname}`);
 | 
						|
        }
 | 
						|
    };
 | 
						|
};
 |