0

In syslog-ng.conf I have the following:

source s_imp { tcp(ip("localhost") port(514)); };

filter f_imp {program("imp");};

destination d_imp {file("/home/rpr/syslog.log");};

log {source(s_imp); filter(f_imp); destination(d_imp);};

I'm using the syslog package to log from a node server. This is the code that I have:

var impLogger = syslog.createClient(514, 'localhost', {name: 'imp'});
impLogger.crit('hello');

The output that I get in syslog.log is:

Apr  6 16:35:17 127.0.0.1 syslog-ng[18571]: Error processing log message: <NaN>2016-04-06T11:05:17.037Z rpr-Inspiron-3521 imp[18500]: hello

How do I fix this?

2
  • you are missing a ; after filter(f_imp) in log {source(s_imp); filter(f_imp) destination(d_imp);}; ..make it log {source(s_imp); filter(f_imp); destination(d_imp);};
    – heemayl
    Apr 6, 2016 at 13:56
  • @heemayl - the issue exists even after adding the semi colon!
    – rohithpr
    Apr 6, 2016 at 15:32

1 Answer 1

2

it seems that the priority(severity) value is missing or invalid at the beginning of the message. Try setting it explicitly in your node code (see https://github.com/cloudhead/node-syslog/blob/master/lib/node-syslog.js)

1
  • For future users: that.options.faculty had to be changed to that.options.facility! issue on github
    – rohithpr
    Apr 6, 2016 at 15:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .