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
2017-04-18 13:52:56 +01:00

17 lines
482 B
TypeScript

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