winston-cloudwatch
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -10,3 +10,3 @@ var util = require('util'), | ||
cloudwatchIntegration.init(options.logGroupName, options.logStreamName, | ||
options.awsAccessKeyId, options.awsSecretKey, options.awsRegion); | ||
options.awsAccessKeyId, options.awsSecretKey, options.awsRegion, options.jsonMessage); | ||
}; | ||
@@ -13,0 +13,0 @@ |
@@ -7,5 +7,6 @@ var AWS = require('aws-sdk'), | ||
logStreamName = '', | ||
messageAsJSON, | ||
intervalId; | ||
module.exports.init = function(awsLogGroupName, awsLogStreamName, awsAccessKeyId, awsSecretKey, awsRegion) { | ||
module.exports.init = function(awsLogGroupName, awsLogStreamName, awsAccessKeyId, awsSecretKey, awsRegion, jsonMessage) { | ||
if (awsAccessKeyId && awsSecretKey && awsRegion) { | ||
@@ -21,2 +22,3 @@ cloudwatchlogs = new AWS.CloudWatchLogs({accessKeyId: awsAccessKeyId, secretAccessKey: awsSecretKey, region: awsRegion}); | ||
logStreamName = awsLogStreamName; | ||
messageAsJSON = jsonMessage; | ||
}; | ||
@@ -26,3 +28,3 @@ | ||
logEvents.push({ | ||
message: [log.level, log.msg, JSON.stringify(log.meta, null, ' ')].join(' - '), | ||
message: messageAsJSON ? JSON.stringify(log, null, ' ') : [log.level, log.msg, JSON.stringify(log.meta, null, ' ')].join(' - '), | ||
timestamp: new Date().getTime() | ||
@@ -29,0 +31,0 @@ }); |
{ | ||
"name": "winston-cloudwatch", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Send logs to Amazon Cloudwatch using Winston.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -72,2 +72,10 @@ winston-cloudwatch [](https://travis-ci.org/lazywithclass/winston-cloudwatch) [](https://david-dm.org/lazywithclass/winston-cloudwatch) | ||
### 0.5.0 | ||
Added `jsonMessage` in options for when you want to send the log object as JSON formatted string | ||
### 0.4.0 | ||
Introduced winston as peer dependency | ||
### 0.3.1 | ||
@@ -74,0 +82,0 @@ |
9617
105
116