This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
tstatic/src/middleware/logging.ts

18 lines
481 B
TypeScript
Raw Normal View History

import * as winston from 'winston';
import * as expressWinston from 'express-winston';
2017-02-15 20:04:46 +00:00
export default expressWinston.logger({
transports: [
new winston.transports.Console({
colorize: true
})
],
meta: false,
msg: '{{ req.url }} '
.concat('status:{{ res.statusCode }} ')
.concat('useragent:{{ req.headers["user-agent"] }} ')
.concat('time:{{ res.responseTime }}ms'),
colorize: true,
statusLevels: true
});