archive
/
tstatic
Archived
1
Fork 0
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
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
})
],
});