diff --git a/README.md b/README.md index 8e2621847..7527dce2e 100644 --- a/README.md +++ b/README.md @@ -819,23 +819,27 @@ The Mail transport uses [emailjs](https://github.com/eleith/emailjs) behind the ### Amazon SNS (Simple Notification System) Transport -The [winston-sns][21] transport uses amazon SNS to send emails, texts, or a bunch of other notifications. +The [winston-sns][18] transport uses amazon SNS to send emails, texts, or a bunch of other notifications. Since this transport uses the Amazon AWS SDK for JavaScript, you can take advantage of the various methods of authentication found in Amazon's [Configuring the SDK in Node.js](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) document. ``` js - require('winston-sns').SNS; - winston.add(winston.transports.SNS, options); + var winston = require('winston'), + winstonSNS = require('winston-sns'); + + winston.add(winstonSNS, options); ``` Options: -* __aws_key:__ Your Amazon Web Services Key. *[required]* -* __aws_secret:__ Your Amazon Web Services Secret. *[required]* * __subscriber:__ Subscriber number - found in your SNS AWS Console, after clicking on a topic. Same as AWS Account ID. *[required]* * __topic_arn:__ Also found in SNS AWS Console - listed under a topic as Topic ARN. *[required]* +* __aws_key:__ Your Amazon Web Services Key. +* __aws_secret:__ Your Amazon Web Services Secret. * __region:__ AWS Region to use. Can be one of: `us-east-1`,`us-west-1`,`eu-west-1`,`ap-southeast-1`,`ap-northeast-1`,`us-gov-west-1`,`sa-east-1`. (default: `us-east-1`) -* __subject:__ Subject for notifications. (default: "Winston Error Report") +* __subject:__ Subject for notifications. Uses placeholders for level (%l), error message (%e), and metadata (%m). (default: "Winston Error Report") * __message:__ Message of notifications. Uses placeholders for level (%l), error message (%e), and metadata (%m). (default: "Level '%l' Error:\n%e\n\nMetadata:\n%m") * __level:__ lowest level this transport will log. (default: `info`) +* __json:__ use json instead of a prettier (human friendly) string for meta information in the notification. (default: `false`) +* __handleExceptions:__ set to true to have this transport handle exceptions. (default: `false`) ### Graylog2 Transport diff --git a/docs/transports.md b/docs/transports.md index 00b28ec95..359fe3b2e 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -288,23 +288,27 @@ The Mail transport uses [node-mail][17] behind the scenes. Options are the foll ### Amazon SNS (Simple Notification System) Transport -The [winston-sns][18] transport uses amazon SNS to send emails, texts, or a bunch of other notifications. +The [winston-sns][18] transport uses amazon SNS to send emails, texts, or a bunch of other notifications. Since this transport uses the Amazon AWS SDK for JavaScript, you can take advantage of the various methods of authentication found in Amazon's [Configuring the SDK in Node.js](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) document. ``` js - require('winston-sns').SNS; - winston.add(winston.transports.SNS, options); + var winston = require('winston'), + winstonSNS = require('winston-sns'); + + winston.add(winstonSNS, options); ``` Options: -* __aws_key:__ Your Amazon Web Services Key. *[required]* -* __aws_secret:__ Your Amazon Web Services Secret. *[required]* * __subscriber:__ Subscriber number - found in your SNS AWS Console, after clicking on a topic. Same as AWS Account ID. *[required]* * __topic_arn:__ Also found in SNS AWS Console - listed under a topic as Topic ARN. *[required]* +* __aws_key:__ Your Amazon Web Services Key. +* __aws_secret:__ Your Amazon Web Services Secret. * __region:__ AWS Region to use. Can be one of: `us-east-1`,`us-west-1`,`eu-west-1`,`ap-southeast-1`,`ap-northeast-1`,`us-gov-west-1`,`sa-east-1`. (default: `us-east-1`) -* __subject:__ Subject for notifications. (default: "Winston Error Report") +* __subject:__ Subject for notifications. Uses placeholders for level (%l), error message (%e), and metadata (%m). (default: "Winston Error Report") * __message:__ Message of notifications. Uses placeholders for level (%l), error message (%e), and metadata (%m). (default: "Level '%l' Error:\n%e\n\nMetadata:\n%m") * __level:__ lowest level this transport will log. (default: `info`) +* __json:__ use json instead of a prettier (human friendly) string for meta information in the notification. (default: `false`) +* __handleExceptions:__ set to true to have this transport handle exceptions. (default: `false`) ### Graylog2 Transport