I am using below Code, but I am not getting logs in my graylogs server also I am not getting any Error in Node Console.
logMsg = "Some Random String";
let logger = new graylog2.graylog({
servers: [
{ 'host': 'XXX.XXX.XXX.XXX', port: 12201 }
],
// hostname: 'server.name', // the name of this host
// (optional, default: os.hostname())
facility: 'MyAPP', // the facility for these log messages
// (optional, default: "Node.js")
bufferSize: 1350 // max UDP packet size, should never exceed the
// MTU of your system (optional, default: 1400)
});
logger.log("info", logMsg);
than you might have some error in your application log sending ⊠or you did not send valid GELF messages. The Graylog server.log might help you a little with that.
We have both TCP and UDP Inputs on same port 12201.
And we have enabled the firewall. We are using AWS and that machine can accept the request from both.
@pankajbansal enable tcp dump (use tcp command) on both ends and monitor for incoming packets on graylog server. If you see the packet coming on the graylog server that means your node js is sending the message but GL is not consuming it and if you donât see the packets coming through something wrong at the source.
commands for tcp dump capture (change it accordingly for tcp). Also, try telnet from source machine.
tcpdump -n udp port 12201
Thanks for all your help.
I am able to get the logs in graylog server by UDP. But I have heard that UDB packets are not guaranteed to reach on server. So we need to use TCP.
So I want to ask weather its needs any additional configuration to send the logs via TCP?