Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log4js-node/logfaces-udp
LogFaces (UDP) appender for log4js-node
https://github.com/log4js-node/logfaces-udp
Last synced: about 1 month ago
JSON representation
LogFaces (UDP) appender for log4js-node
- Host: GitHub
- URL: https://github.com/log4js-node/logfaces-udp
- Owner: log4js-node
- License: apache-2.0
- Created: 2018-07-05T22:39:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T22:08:59.000Z (over 1 year ago)
- Last Synced: 2024-12-05T14:07:16.610Z (about 2 months ago)
- Language: JavaScript
- Size: 893 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logFaces Appender (UDP) for log4js-node
The logFaces appenders send JSON formatted log events to [logFaces](http://www.moonlit-software.com) receivers. This appender uses UDP to send the events (there is another logFaces appender that uses [HTTP](https://github.com/log4js-node/logFaces-HTTP/)). It uses the node.js core UDP support, so you do not need to include any other dependencies.
```bash
npm install log4js @log4js-node/logfaces-udp
```## Configuration
* `type` - `@log4js-node/logfaces-udp`
* `remoteHost` - `string` (optional, defaults to '127.0.0.1')- hostname or IP address of the logFaces receiver
* `port` - `integer` (optional, defaults to 55201) - port the logFaces receiver is listening on
* `application` - `string` (optional, defaults to empty string) - used to identify your application's logsThis appender will also pick up Logger context values from the events, and add them as `p_` values in the logFaces event. See the example below for more details.
# Example (default config)
```javascript
log4js.configure({
appenders: {
logfaces: { type: '@log4js-node/logfaces-udp' }
},
categories: {
default: { appenders: [ 'logfaces' ], level: 'info' }
}
});const logger = log4js.getLogger();
logger.addContext('requestId', '123');
logger.info('some interesting log message');
logger.error('something has gone wrong');
```
This example will result in two log events being sent via UDP to `127.0.0.1:55201`. Both events will have a `p_requestId` property with a value of `123`.