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
Raw Normal View History

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