# nodejs: Receive JSON messages from nodejs applications

Using the `nodejs()` driver, AxoSyslog can receive application logs directly from nodejs applications that use the widespread [Winston](<https://github.com/winstonjs/winston>) logging API. The AxoSyslog 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 AxoSyslog 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 [Reusing configuration blocks](../../docs/axosyslog-core/chapter-configuration-file/large-configs/config-blocks/index.md). You can find the source of the nodejs configuration snippet on [GitHub](<https://github.com/axoflow/axosyslog/blob/master/scl/nodejs/plugin.conf>).

## Example: 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 AxoSyslog host.
```
 
       @include "scl.conf"
        source apps { nodejs(); };
    
```

The following example listens only on IP address `192.168.1.1`, port `9999`.
```
 
       @include "scl.conf"
        source apps {
            nodejs(
                localip(192.168.1.1)
                port(9999)
            )
        };
    
```

Note For details on the parameters of the `nodejs()` driver, see [nodejs() source options](../../docs/axosyslog-core/chapter-sources/configuring-source-nodejs/reference-source-nodejs/index.md). 

* * *

[nodejs() source options](../../docs/axosyslog-core/chapter-sources/configuring-source-nodejs/reference-source-nodejs/index.md)

Last modified June 4, 2024: [More github link updates (13f3206e)](<https://github.com/axoflow/axosyslog-core-docs/commit/13f3206e659157ec0efc7371296867db7371b637>)