https://github.com/teragrep/jla_05
Teragrep RELP appender for Log4j 1.x
https://github.com/teragrep/jla_05
java log log-management log4j log4j-appender logger logging relp relp-client syslog syslog-client teragrep
Last synced: 30 days ago
JSON representation
Teragrep RELP appender for Log4j 1.x
- Host: GitHub
- URL: https://github.com/teragrep/jla_05
- Owner: teragrep
- License: apache-2.0
- Created: 2021-05-31T10:22:22.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T08:57:19.000Z (over 1 year ago)
- Last Synced: 2025-03-29T15:02:13.667Z (about 2 months ago)
- Topics: java, log, log-management, log4j, log4j-appender, logger, logging, relp, relp-client, syslog, syslog-client, teragrep
- Language: Java
- Homepage: https://teragrep.com
- Size: 42 KB
- Stars: 0
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Log4j RELP Plugin
image::https://scan.coverity.com/projects/23199/badge.svg[Build Status, link="https://scan.coverity.com/projects/jla_05"]
Creates Log4j appender that uses RELP to ensure no events are lost.
See https://github.com/teragrep/jla_05/blob/master/src/main/resources/log4j.example.properties[log4j.example.properties] for example config
== Please note
Please note that regarding log4j version 1.2.17 following vulnerabilities exist and we recommend not to use these features:
* https://nvd.nist.gov/vuln/detail/CVE-2020-9488[CVE-2020-9488] Improper validation of certificate with host mismatch in Apache Log4j SMTP appender.
* https://nvd.nist.gov/vuln/detail/CVE-2019-17571[CVE-2019-17571] Included in Log4j 1.2 is a SocketServer class that is vulnerable to deserialization of untrusted data which can be exploited to remotely execute arbitrary code when combined with a deserialization gadget when listening to untrusted network traffic for log data.== Property explanations
|===
|Property |Description|log4j.appender.RELPAPPENDER.relpAddress
|Connection destination address
|log4j.appender.RELPAPPENDER.relpPort
|Connection destination port
|log4j.appender.RELPAPPENDER.appName
|Stream application identifier. Maximum length of 48 characters, limited by RFC5424
|log4j.appender.RELPAPPENDER.hostname
|Stream host identifier. Maximum length of 255 characters, limited by RFC5424
|log4j.appender.RELPAPPENDER.connectionTimeout
|Time to wait before timing out connection
|log4j.appender.RELPAPPENDER.writeTimeout
|Time to wait for destination to accept data
|log4j.appender.RELPAPPENDER.readTimeout
|Time to wait for destination to acknowledge sent data (low values cause duplicates)
|log4j.appender.RELPAPPENDER.reconnectInterval
|Time to wait between re-connection attempts
|log4j.appender.RELPAPPENDER.useSD
|Enables structured data containing uuid and source information
|===== Usage
Pass log4j.properties file as property
```
-Dlog4j.configuration=file:/path/to/log4j.properties
```Using the logger
```
static Logger logger = Logger.getLogger(MyClass.class.getName());
logger.info("Info Message");
logger.warn("Warning message");
logger.trace("Trace message");
// Finally shutdown so RELP can disconnect gracefully
LogManager.shutdown();
```== Maven dependency definition
```
com.teragrep
jla_05
%VERSION%```
== Configuring pre-built log4j application
First download wanted versions of jla_05, rlp_01 and rlo_14 from the following urls:
* https://search.maven.org/artifact/com.teragrep/jla_05[jla_05]
* https://search.maven.org/artifact/com.teragrep/rlp_01[rlp_01]
* https://search.maven.org/artifact/com.teragrep/rlo_14[rlo_14]Then run java while pointing classpath to the directory where you downloaded the jars to like:
```
java -cp "path/to/downloaded/jars/*:target/example.jar" com.teragrep.example.Main
```== 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/jla_05/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.