{"id":26234028,"url":"https://github.com/teragrep/javascript-logging-demo","last_synced_at":"2025-12-30T04:25:44.676Z","repository":{"id":49784729,"uuid":"516674447","full_name":"teragrep/javascript-logging-demo","owner":"teragrep","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-12T12:38:02.000Z","size":809,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-17T19:13:15.877Z","etag":null,"topics":["demo","javascript","relp","relp-client","syslog-client"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teragrep.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-22T08:39:18.000Z","updated_at":"2024-01-13T20:59:29.000Z","dependencies_parsed_at":"2023-01-29T20:46:22.186Z","dependency_job_id":null,"html_url":"https://github.com/teragrep/javascript-logging-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjavascript-logging-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjavascript-logging-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjavascript-logging-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Fjavascript-logging-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/javascript-logging-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318878,"owners_count":20272173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","javascript","relp","relp-client","syslog-client"],"created_at":"2025-03-13T01:18:32.110Z","updated_at":"2025-12-30T04:25:44.637Z","avatar_url":"https://github.com/teragrep.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# javascript-logging-demo\n\nUser Story: As a dev/customer I would like to know how the rlo_08 + rlp_02 do work together in a real application\n\n* Demo web client app sends the HTTP request message (message1) to the node server\n* Server uses the RLO_08 library to build the Syslog message including the User Agent details from the Demo web client app and send HTTP response for the demo web client app request\n** log the user agent used in the request\n* Display the syslog message with rlp_03 example application (https://github.com/teragrep/java-relp-server-demo)\n* Use github workflow to setup the environment:\n** Launch the rlp_03 for listening data\n*** Show logged lines of the rlp_03\n** Launch server with rlo_08 and rlp_02\n*** RELP Connection should be kept online for sending meaning not connect and disconnect for each message.\n** Launch demo web client app\n*** Make request\n\n== High-level Architecture\nimage::https://github.com/teragrep/javascript-logging-demo/blob/base-feat/images/rlo_08_demo_arch.png[alt=\"Architecture\",width=700,height=400]\n\n\n== Implementation\n\n* `Package.json installation of *rlp_02 and rlo_08*`\n+\n[source,node]\n-----------------\nnpm install \n-----------------\n\n* Module usage:\n+\n[source,javascript]\n-----------------\nconst { SyslogMessage, Facility, SDElement, SDParam, Severity } = require('@teragrep/rlo_08')\nconst { RelpConnection, RelpBatch } = require('@teragrep/rlp_02')\n-----------------\n\n* RelpConnection usage:\n+\n[source,javascript]\n-----------------\nasync function setupConnection(port, host){\n    return new Promise(async (resolve, reject) =\u003e {\n      relpConnection = new RelpConnection();\n      let conn = await relpConnection.connect(port, host);\t\n      console.log('Connectig...',host,' at PORT ', port)\n      resolve(relpConnection)\n    })\n  }\n-----------------\n\n* `Runtime  *INSTRUCTIONS*`\n** First, Make sure that run our java-relp-server-demo application jar\n+\n[source,java]\n-----------------\njava -jar java-relp-server-demo-jar-with-dependencies.jar\n-----------------\n\n** Build\n+\n[source,java]\n-----------------\nmvn clean package\n-----------------\n\n* OPTIONAL *TIPS*\n** You can run the test-server and make curl request to the server listening port at 3000\n** * Run Server:\n+\n[source,javascript]\n-----------------\nnode test-server.js\n-----------------\n\n** CURL request to the our test server running on PORT 3000\n+\n[source,shell]\n-----------------\ncurl localhost:3000/ua\n-----------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Fjavascript-logging-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Fjavascript-logging-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Fjavascript-logging-demo/lists"}