forked from BohdanTkachenko/websockets-stress-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.js
37 lines (29 loc) · 790 Bytes
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(function() {
"use strict";
var winston = require('winston');
var levels = {
httpLog: 0,
wsLog: 1
};
var logger = new (winston.Logger)({
levels: levels,
fields:['message','responseTime','url'],
transports: [
new winston.transports.File({
name: 'httpLog',
level: 'httpLog',
filename: 'http.log',
json: true,
colorize: false
}),
new winston.transports.File({
name: 'wsLog',
level: 'wsLog',
filename: 'ws-logs.log',
json: true,
colorize: false
}),
]
});
module.exports = logger;
} ());