New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

winston-cloudwatch

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-cloudwatch - npm Package Compare versions

Comparing version

to
1.11.4

examples/error.js

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### 1.11.4
Correctly stringifies Error objects preserving stuff like the message and the stack
Fixes https://github.com/lazywithclass/winston-cloudwatch/issues/54
### 1.11.3

@@ -2,0 +8,0 @@

2

index.js

@@ -23,3 +23,3 @@ 'use strict';

var messageFormatter = options.messageFormatter ? options.messageFormatter : function(log) {
return _.isEmpty(log.meta) ?
return _.isEmpty(log.meta) && !(log.meta instanceof Error) ?
[ log.level, log.msg ].join(' - ') :

@@ -26,0 +26,0 @@ [ log.level, log.msg, stringify(log.meta) ].join(' - ');

var chalk = require('chalk');
function stringify(o) { return JSON.stringify(o, null, ' '); }
function handleErrorObject(key, value) {
if (value instanceof Error) {
return Object.getOwnPropertyNames(value).reduce(function(error, key) {
error[key] = value[key]
return error
}, {})
}
return value
}
function stringify(o) { return JSON.stringify(o, handleErrorObject, ' '); }

@@ -24,1 +33,2 @@ function debug() {

};
{
"name": "winston-cloudwatch",
"version": "1.11.3",
"version": "1.11.4",
"description": "Send logs to Amazon Cloudwatch using Winston.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -1,2 +0,2 @@

# winston-cloudwatch [v1.11.3](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#1113)
# winston-cloudwatch [v1.11.4](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#1114)

@@ -40,2 +40,7 @@ [![Build Status](https://travis-ci.org/lazywithclass/winston-cloudwatch.svg?branch=master)](https://travis-ci.org/lazywithclass/winston-cloudwatch) [![Coverage Status](https://coveralls.io/repos/github/lazywithclass/winston-cloudwatch/badge.svg?branch=master)](https://coveralls.io/github/lazywithclass/winston-cloudwatch?branch=master) [![Dependency Status](https://david-dm.org/lazywithclass/winston-cloudwatch.svg)](https://david-dm.org/lazywithclass/winston-cloudwatch) [![dev dependencies](https://david-dm.org/lazywithclass/winston-cloudwatch/dev-status.svg)](https://david-dm.org/lazywithclass/winston-cloudwatch#info=devDependencies) [![peer dependencies](https://david-dm.org/lazywithclass/winston-cloudwatch/peer-status.svg)](https://david-dm.org/lazywithclass/winston-cloudwatch#info=peerDependencies)

As a best practice remember to use one stream per resource, so for example if you have 4 servers you should setup 4 streams
on AWS CloudWatch Logs, this is a general best practice to avoid incurring in token clashes and to avoid limits of the service (see [usage](#usage) for more).
#### Region note
As specified [in the docs](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Setting_the_Region):

@@ -49,4 +54,10 @@

#### AWS UI
For displaying time in AWS CloudWatch UI you should click on the gear in the top right corner in the page with your logs and enable checkbox "Creation Time".
##### TypeScript
Remember to install types for both winston and this library.
### Usage

@@ -53,0 +64,0 @@