https://github.com/teragrep/rlo_08
Syslog (RFC 5424) formatter for JavaScript
https://github.com/teragrep/rlo_08
javascript javascript-library javascript-syslog log-management logging rfc-5424 rfc5424 syslog syslog-formatter teragrep
Last synced: 9 months ago
JSON representation
Syslog (RFC 5424) formatter for JavaScript
- Host: GitHub
- URL: https://github.com/teragrep/rlo_08
- Owner: teragrep
- License: apache-2.0
- Created: 2022-02-07T10:57:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T10:46:45.000Z (10 months ago)
- Last Synced: 2025-04-07T11:33:59.238Z (10 months ago)
- Topics: javascript, javascript-library, javascript-syslog, log-management, logging, rfc-5424, rfc5424, syslog, syslog-formatter, teragrep
- Language: JavaScript
- Homepage: https://teragrep.com
- Size: 123 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
image::https://avatars.githubusercontent.com/u/71876378?s=200&v=4[Teragrep Logo]
# RLO_08: Syslog (RFC 5424) formatter for JavaScript
Generates Syslog messages in RFC 5424 format.
### Generate the Syslog messages
```javascript
let message = new SyslogMessage.Builder()
.withAppName('bulk-data-sorted')
//.withTimestamp(timestamp) // In case if the timestamp disabled, it will go with system timestamp.
.withHostname('iris.teragrep.com')
.withFacility(Facility.LOCAL0)
.withSeverity(Severity.INFORMATIONAL)
.withProcId('8740')
.withMsgId('ID47')
.withMsg('Don’t test it as NÀSÀ¶¶ Àpplication') // Fixed: Problem with handling utf8 characters.
.withSDElement(new SDElement("exampleSDID@32473", new SDParam("iut", "3"), new SDParam("eventSource", "Àpplication"))) //Updated support for UTF-8
.build()
```
## RLP_02 Integration & Configuration
### Install RLP_02
```cmd
npm install @teragrep/rlp_02
```
### RLP_02 RelpConnection configuration & usage
```javascript
let relpConnection = new RelpConnection();
let host = '127.0.0.1';
let port = <>;
async.waterfall(
[
function init(setConnect) {
setConnect(null, port, host)
},
connect,
load,
commit,
disconnect
],
function (err) {
if(err) {
console.log(err);
}
else {
console.log('No Error')
}
}
)
async function connect() {
let conn = await relpConnection.connect(cfePort, host);
return conn;
}
async function disconnect(state) {
if(state){
await relpConnection.disconnect();
}
else {
console.log('Check the connection...')
}
}
```
## Contributing
// Change the repository name in the issues link to match with your project's name
You can involve yourself with our project by https://github.com/teragrep/rlo_08/issues/new/choose[opening an issue] or submitting a pull request.
Contribution requirements:
. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.
. Security checks must pass
. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.
. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).
Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].
### Contributor License Agreement
Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.