syslog-ng documentation

Your main source of knowledge

The syslog-ng product family has an extensive documentation, covering everything from how to install a product to the most complex configuration and settings descriptions. If you cannot find an answer to your question, try the mailing list - our community is always eager to help.

syslog-ng Open Source Edition


6.6. nodejs: Receiving JSON messages from nodejs applications

Using the nodejs() driver, syslog-ng OSE can receive application logs directly from nodejs applications that use the widespread Winston logging API. The syslog-ng OSE application automatically adds the .nodejs.winston. prefix to the name of the fields the extracted from the message.

To use the nodejs() driver, the scl.conf file must be included in your syslog-ng OSE configuration:

@include "scl.conf"

The nodejs() driver is actually a reusable configuration snippet configured to receive log messages using the network() driver, and process its JSON contents. For details on using or writing such configuration snippets, see Section 5.6.2, Reusing configuration blocks. You can find the source of the nodejs configuration snippet on GitHub.

Example 6.18. Using the nodejs() driver

The following example uses the default settings of the driver, listening for messages on port 9003 of every IP address of the syslog-ng OSE host.

@include "scl.conf"
source apps { nodejs(); };

The following example listens only on IP address, port 9999.

@include "scl.conf"
source apps { nodejs(

For details on the parameters of the nodejs() driver, see Section 6.6.1, nodejs() source options.