We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db2e6c4 commit 32b9140Copy full SHA for 32b9140
lib/index.js
@@ -44,8 +44,15 @@ var Logsene = function (options) {
44
options.type || 'winston_logsene',
45
options.url)
46
var self = this
47
- this.logger.on('error', function (err) {
48
- self.emit('error', err)
+ this.logger.on('error', function (e) {
+ const { err } = e
49
+
50
+ if (err.code === 'EAI_AGAIN') {
51
+ console.log(new Date().toISOString() + ` winston-logsene: cannot reach the receiver URL: ${err.url}, please check your network connection ...`)
52
+ return
53
+ }
54
55
+ self.emit('error', e)
56
})
57
this.logger.on('log', function (data) {
58
self.logCount = self.logCount - data.count
0 commit comments