Showing
1 changed file
with
8 additions
and
4 deletions
1 | - var winston = require('winston'); | ||
2 | - var influxdb =require('../index'); | ||
3 | - var logger = new (winston.Logger)({ | 1 | + "use strict"; |
2 | + | ||
3 | + let winston = require('winston'), | ||
4 | + influxdb =require('../index'), | ||
5 | + logger = new (winston.Logger)({ | ||
4 | transports: [ | 6 | transports: [ |
5 | new (winston.transports.TcpTransport)({ //send by tcp | 7 | new (winston.transports.TcpTransport)({ //send by tcp |
6 | level:'info', //logger level | 8 | level:'info', //logger level |
@@ -12,11 +14,13 @@ | @@ -12,11 +14,13 @@ | ||
12 | new (winston.transports.UdpTransport)({ //send by udp | 14 | new (winston.transports.UdpTransport)({ //send by udp |
13 | level:'debug', //logger level | 15 | level:'debug', //logger level |
14 | host:'192.168.102.162', //influxdb host | 16 | host:'192.168.102.162', //influxdb host |
15 | - port:'4444'//influxdb port | 17 | + port:'4444',//influxdb port |
18 | + measurement:'example' | ||
16 | }), | 19 | }), |
17 | new (winston.transports.Console)() | 20 | new (winston.transports.Console)() |
18 | ] | 21 | ] |
19 | }); | 22 | }); |
23 | + | ||
20 | logger.log('info', 'Hello distributed log files!','dasda'); | 24 | logger.log('info', 'Hello distributed log files!','dasda'); |
21 | logger.info('Hello again distributed logs'); | 25 | logger.info('Hello again distributed logs'); |
22 | 26 |
-
Please register or login to post a comment