From 8dbcaeaa10a657b4782b5aaf7418bc25bc8d59b3 Mon Sep 17 00:00:00 2001 From: Shweta Jain Date: Wed, 27 Jun 2018 14:03:36 +0530 Subject: [PATCH 1/2] Add new flag for network errors --- lib/winston-loggly.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/winston-loggly.js b/lib/winston-loggly.js index 8437a87..ca82fb8 100644 --- a/lib/winston-loggly.js +++ b/lib/winston-loggly.js @@ -57,7 +57,8 @@ var Loggly = exports.Loggly = function (options) { token: options.token, tags: tags, isBulk: options.isBulk || false, - bufferOptions: options.bufferOptions || {size: 500, retriesInMilliSeconds: 30 * 1000} + bufferOptions: options.bufferOptions || {size: 500, retriesInMilliSeconds: 30 * 1000}, + networkErrorsOnConsole: options.networkErrorsOnConsole || false }); this.timestamp = options.timestamp === false ? false : true; diff --git a/package.json b/package.json index 9915cfa..e6accdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "winston-loggly-bulk", - "version": "2.0.2", + "version": "2.0.3", "description": "A Loggly transport for winston", "author": "Loggly ", "contributors": [ From fa967afb8ee16836fc8c2f4670058c764b18ed4c Mon Sep 17 00:00:00 2001 From: Shweta Jain Date: Wed, 27 Jun 2018 17:15:17 +0530 Subject: [PATCH 2/2] Update README for the new flag --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 63353b9..0dd1983 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The Loggly transport is based on [Nodejitsu's][2] [node-loggly][3] implementatio - __retriesInMilliSeconds:__ Time in milliseconds to retry sending buffered logs. * __timestamp:__ If false, library will not include timestamp in log events. - __Note:__ Library includes timestamp by default when we do not set timestamp option. +* __networkErrorsOnConsole:__ The library keep track of different network errors and can log them to console. By default, logging errors on console is disabled and can be enabled easily by setting this parameter's value to `true`. If true, all the network errors will be logged to console. *Metadata:* Logged in suggested [Loggly format][5]