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

Handle loggly errors #3

Open
naholyr opened this issue Aug 17, 2012 · 1 comment
Open

Handle loggly errors #3

naholyr opened this issue Aug 17, 2012 · 1 comment

Comments

@naholyr
Copy link

naholyr commented Aug 17, 2012

Currently, there is absolutely no error handling:

    this.client.log(this.inputToken, message, function () {
      self.emit('logged');
      callback(null, true);
    });

Today I face (not sure if it's usual with Loggly, I use it only very recently) a lot of "Error: socket hang up" errors. At least half of my events are not sent, and there is no way I can know it from the transport :(

You could change this part to something like this so we can plug to "error" event:

    this.client.log(this.inputToken, message, function (err) {
      self.emit(err ? 'error' : 'logged', err);
      callback(err, !!err);
    });

Or at least pass err to callback so we can catch it and re-call log().

@perevernihata
Copy link

+1 to @naholyr , 4 years passed but this code is still in the repo and being a real pain.

OtterCode pushed a commit to OtterCode/winston-loggly that referenced this issue Jun 22, 2018
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