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

on error does not get called if server is down #15

Open
rparies opened this issue Feb 24, 2016 · 4 comments
Open

on error does not get called if server is down #15

rparies opened this issue Feb 24, 2016 · 4 comments

Comments

@rparies
Copy link

rparies commented Feb 24, 2016

hello, i was assuming that if the graylog server was down , the on error would be called.
if the server is up, my messages are being sent correctly and can be seen on graylog
i am using version 0.1.3

this is my code snippet:

thanks for any help

var gl2 = new graylog2.graylog({
      servers: config.loggingService.graylog2.servers,       
      bufferSize: config.loggingService.graylog2.bufferSize   
    });
gl2.on('error', function (error) {
      console.error('Error while trying to write to graylog2:', error);
    });


@ronkorving
Copy link
Collaborator

Because the Graylog protocol runs over UDP, I don't think there's any way to guarantee delivery. You'll have to monitor your Graylog server independently to know if it's up.

The error event will be emitted on a DNS lookup failure for example, but as far as I'm aware it cannot be triggered by a delivery failure.

@petermikitsh
Copy link

I'm running a local graylog instance (via docker) and logging via this module. No log messages are showing up in the web portal. It's a shame there's no way to validate where in the pipeline things are going wrong.

What would be beneficial, however, is to have some documentation of how to properly configure a graylog server when using this module.

@ronkorving
Copy link
Collaborator

I'm not sure I follow. How does the configuration of the graylog server impact the use of this module? In any case, if there are things to take into account in your opinion, a pull request to the readme is always most welcome.

@petermikitsh
Copy link

@ronkorving If you take a fresh, vanilla Graylog Server instance and use this package, it won't capture logs. You have to go to <hostname>/system/inputs in the graylog web client, and create a GELF UDP input.

screen shot 2016-08-29 at 9 40 08 am

After creating the input, you use the graylog server's hostname and port (e.g., 12201) and supply it to the graylog2 constructor, e.g.,

var logger = new graylog2.graylog({
  servers: [{
    'host': 'hostname',
    port: 12201
  }]
});

It's pretty simple after you set it up once, but as a new graylog user, I stumbled for a bit.

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

3 participants