Skip to content

teragrep/rlo_08

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teragrep Logo

Syslog Javascript Client

RLO_08

Client Library written in Javascript to send messages to a Syslog server

Generate the Syslog messages

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

npm install @teragrep/rlp_02

RLP_02 RelpConnection configuration & usage

let relpConnection = new RelpConnection();
let host = '127.0.0.1';
let port = <<SET YOUR 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

You can involve yourself with our project by opening an issue or submitting a pull request.

Contribution requirements:

  1. 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.

  2. Security checks must pass

  3. Pull requests must align with the principles and values of extreme programming.

  4. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).

Read more in our Contributing Guideline.

Contributor License Agreement

Contributors must sign 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.