{"id":26234022,"url":"https://github.com/teragrep/rlp_06","last_synced_at":"2026-04-21T18:03:48.723Z","repository":{"id":166306371,"uuid":"641451267","full_name":"teragrep/rlp_06","owner":"teragrep","description":"Teragrep Syslog-RELP Developer Example for Java","archived":false,"fork":false,"pushed_at":"2025-04-07T11:50:18.000Z","size":35,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T12:39:39.001Z","etag":null,"topics":["java","syslog","teragrep"],"latest_commit_sha":null,"homepage":"https://teragrep.com","language":"Java","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-16T13:50:00.000Z","updated_at":"2025-02-05T13:51:50.000Z","dependencies_parsed_at":"2025-04-07T12:38:54.952Z","dependency_job_id":null,"html_url":"https://github.com/teragrep/rlp_06","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/teragrep/rlp_06","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_06","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_06/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_06/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_06/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/rlp_06/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_06/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005999,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["java","syslog","teragrep"],"created_at":"2025-03-13T01:18:31.979Z","updated_at":"2025-12-24T18:10:57.085Z","avatar_url":"https://github.com/teragrep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Java Syslog-RELP Developer Example\n\n== Overview\nJava syslog-RELP Developer Example project guides through design considerations with an actual example. The example uses https://www.rfc-editor.org/rfc/rfc5424[syslog] with Reliable Event Logging Protocol (https://en.wikipedia.org/wiki/Reliable_Event_Logging_Protocol[RELP]) in https://en.wikipedia.org/wiki/Java_(programming_language)[Java] programming language. \n\nThe project also utilizes Teragrep Java RELP Library (https://github.com/teragrep/rlp_01[rlp_01]). Rlp_01 ensures reliable record processing in Java applications. It uses optional https://en.wikipedia.org/wiki/Transport_Layer_Security[TLS] encryption and public-key https://en.wikipedia.org/wiki/Public_key_certificate[certificate] verification.\n\n== Background\nSyslog is a record format standard for message logging. It allows separation of: \n\n* the software that produces message records, \n* the system that stores them, and \n* the software that reports and analyzes them.\n\nWhen you use syslog as a record format, you can ensure the produced records are accessible. \n\nRELP is a transport protocol. It allows reliable, encrypted and robust transmission of syslog records. With RELP, you can integrate with many syslog based systems. The mechanism is reliable for transporting the syslog messages over network.\n\nSyslog and RELP allow a real-time record streaming, from an application to an archival and analytics system. Take https://github.com/teragrep/teragrep/[Teragrep] as an example.\n\n=== Example about application logging\n\nApplication is producing many record streams containing valuable information about:\n\n* requests, including transaction processing\n* authentication\n* authorization\n* session handling\n* functional errors\n* technical errors\n* debugging\n* runtime metric data\n\nAll these are separate record streams from a single application. The application could, for example, handle web-shop orders.\n\nSyslog record format allows capturing all these into their own streams. Meanwhile, the origin of the information is kept in the record metadata.\n\n=== Example records for preceding example\n\n*Requests*\n[source,text]\n\u003c15\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-requests - - - 127.0.0.1 - - [01/Jan/2023:00:00:00 +0300] \"GET /webshop/ HTTP/1.1\" 200 1995 \"https://referer.example.com\" \"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0\"\n\n*Authentication*\n[source,text]\n\u003c15\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-auth - - - {\"event\": \"login\", \"source\": \"127.0.0.1:38238\", \"username\": \"user1\", \"authentication method\": \"password\"}\n\n*Authorization*\n[source,text]\n\u003c15\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-authz - - - {\"SUBJECT\": \"user:admin1\", \"VERB\": \"ASSUME\", \"OBJECT\": \"role:Administrators\", \"STATUS\": \"assume-ok\"}\n\n*Session handling*\n[source,text]\n\u003c16\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-session - - - login \u003c[user1]\u003e, operation \u003ccreate\u003e, object_type \u003csession\u003e\n\n*Functional error*\n[source,text]\n\u003c12\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-logic-err - - - Checkout amount negative, calculated as \u003c-100€\u003e. discount coupons given: \"2023FREE\" by user: \"user1\" rejecting purchase;\n\n*Technical error*\n[source,text]\n\u003c13\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-tech-err - - - Database connection to 127.0.0.2:3306 timed out.\n\n*Debugging*\n[source,text]\n\u003c17\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-debug - - - Ensuring my code works properly enuf\n\n*Runtime metric data*\n[source,text]\n\u003c17\u003e1 2023-01-01T00:00:00.123456+00:00 app-server1.example.com web-shop-metric - - - \"time_taken\":348\n\nAs seen above, syslog is able to capture all information. At the same time, the payload part of the record keeps information as human-readable. Delivery and retention of this kind of information is essential for the business.\n\nBy following this guide, you can ensure that records:\n\n* are handled in a proper manner, \n* contain essential metadata and \n* are delivered without loss and in real-time from the application for further processing.\n\n== Ready-Made Application Integrations for Syslog-RELP\n\nFor logging use, Teragrep ships following libraries:\n\n* https://github.com/teragrep/jla_01[Relp Logging plugin for Logback]\n* https://github.com/teragrep/jla_04[Java Util Logging RELP Handler]\n* Log4j 1.x https://github.com/teragrep/jla_05[Log4j RELP Plugin]\n* Log4j 2.x https://github.com/teragrep/jla_06[Log4j2 RELP Plugin]\n\nYou can use these libraries as part of the relevant logging framework. They integrate with their relevant logging framework by extending existing capabilities.\n\nNOTE: Ready made libraries work well for the logging use. However, you may want more control over the syslog and RELP in other integrations (i.e. send the set the timestamp or https://en.wikipedia.org/wiki/Universally_unique_identifier[uuid] of the record). For this, see the next section.\n\n== Syslog-RELP Integration Guidelines\n\n=== General\n\n* test cases must be executable\n* errors (executions) must not be hidden\n* server port needs to be configurable\n* server address needs to be configurable\n\n=== Syslog\n\n==== Headers\n* Wrap messages in syslog envelope\n* Syslog-hostname must be configurable\n* Syslog app-name must be configurable\n\nNOTE: Sharing same syslog-hostname and syslog-app names allow parallel deployments of the application to share the same processing rules.\n\n[source,java]\n----\n// see SyslogRecordTest.java\n----\n\n==== Structured-data\n* Include origin data in syslog structure-data\n* Include original uuid in syslog structured-data\n\nNOTE: Structured-data is a managed schema. Adding new fields with our https://en.wikipedia.org/wiki/Private_enterprise_number[48577] is not a good idea.\n\n[source,java]\n----\n// see SyslogRecordWithSDTest.java\n----\n\n=== RELP\n\n==== Non-functional requirements\n\n* Retry always and do not lose messages\n* Processing mustn't hang infinitely due to technical issues, but rather retry new connection\n\n[source,java]\n----\n// see CompleteExampleTest.java\n----\n\n==== RELP TLS\n\nSee https://github.com/teragrep/rlp_03/blob/main/src/test/java/com/teragrep/rlp_03/TlsClientTest.java[TlsClientTest.java] on rlp_03 repository.\n\n== Contributing\n \n// Change the repository name in the issues link to match with your project's name\n \nYou can involve yourself with our project by https://github.com/teragrep/rlp_06/issues/new/choose[opening an issue] or submitting a pull request.\n \nContribution requirements:\n \n. *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.\n. Security checks must pass\n. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.\n. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).\n \nRead more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].\n \n=== Contributor License Agreement\n \nContributors 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.\n \nYou need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frlp_06","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Frlp_06","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frlp_06/lists"}