forked from jayathuam/node-red-contrib-advance-logger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
38 lines (30 loc) · 1.01 KB
/
test.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
var winston = require('winston');
var logger = new winston.Logger({
exitOnError: false,
level: 'info',
transports: [
new (winston.transports.Console)({
colorize: true,
prettyPrint : true
}),
new (winston.transports.File)(
{
filename: 'somefile1.log',
maxsize: 1073741824,
maxFiles: 10,
level: 'info',
colorize: true,
handleExceptions: true,
humanReadableUnhandledException: true,
json : true,
zippedArchive : true,
prettyPrint : true
})
]
});
winston.handleExceptions(new winston.transports.File({ filename: 'exceptions.log' }));
setInterval(function () {
logger.log('info', 'Hello distributed log files!');
logger.error('Hello again distributed logs');
logger.warn("127.0.0.1 - there's no place like home");
}, 30);