brianloveswords / messina

Pipe your Bunyan logs to Graylog2 with standard unix pipes
MIT License
13 stars 2 forks source link

Not sending logs to Graylog #5

Open gvko opened 7 years ago

gvko commented 7 years ago

I'm setting up with the following implementation:

  process.env.GRAYLOG_HOST = 'http://graylog-server/gelf';
  process.env.GRAYLOG_PORT = 12201;
  process.env.GRAYLOG_FACILITY = serviceName;

  const logger = messina({
    name: serviceName,
    streams: [
      {
        level: 'info'
        stream: process.stdout,
        formatter: 'pretty',
        period: '1d',
        count: 7
      },
      {
        level: 'error',
        stream: process.stderr,
        formatter: 'pretty',
        period: '1d',
        count: 7
      }
    ]
  });

But logs are not being sent to Graylog. I am sure the connection works because when I do a curl request:

curl -X POST -H 'Content-Type: application/json' -d '{ "message": "UAHSDUHAUSDHUASHUS" }' 'http://graylog-server:12201/gelf'

everything works fine.

Am I doing something wrong in the bunyan config object?