Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport "error" callback is firing #70

Open
pasupulaphani opened this issue May 8, 2017 · 1 comment
Open

Transport "error" callback is firing #70

pasupulaphani opened this issue May 8, 2017 · 1 comment

Comments

@pasupulaphani
Copy link

The connection seems to be falling off for long-lived connections.

    const winstonPapertrail = new winston.transports.Papertrail(options)
    this.logger = new winston.Logger({
      levels: this.options.levels,
      transports: [winstonPapertrail]
    })

    winstonPapertrail.on('error', (err) => {
      this.emit('error', new Error('INSTANTIATION_FAILED', err))
    })

Error output to stdout:

There was a problem (Error: INSTANTIATION_FAILED) in papertrail and it has been destroyed.

Any ideas on how to avoid this? or reconnect automatically?

@troy troy changed the title papertrail has been destroyed. Transport "error" callback is firing May 8, 2017
@troy
Copy link
Contributor

troy commented May 8, 2017

(I changed the issue title to reflect what you seem to be reporting, since the this.emit code, and thus the error string, seems to be code that you wrote)

What version of the transport are you using? In 1.0.4, the error callback is called but shouldn't be fatal; the library will automatically reconnect. Check out the README for an example of the recommended error callback handler, which is basically to do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants