Skip to content

teragrep/jla_06

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log4j2 RELP Plugin

Usage

Pass log4j2.properties file as property

-Dlog4j2.configurationFile=file:/path/to/log4j2.properties

Example log4j2.properties

name=PropertiesConfig

filters=threshold
filter.threshold.type=ThresholdFilter
filter.threshold.level=DEBUG

appenders=RelpAppender

appender.RelpAppender=com.teragrep.jla_06.RelpAppender
appender.RelpAppender.name=RelpAppender
appender.RelpAppender.type=RelpAppender
appender.RelpAppender.layout.type=PatternLayout
appender.RelpAppender.layout.pattern=[%p] [%F#%L] [%C] %m%n
appender.RelpAppender.relpAddress=localhost
appender.RelpAppender.relpPort=1666
appender.RelpAppender.appName=jla_06
appender.RelpAppender.hostname=localhost
appender.RelpAppender.connectionTimeout=5000
appender.RelpAppender.writeTimeout=2000
appender.RelpAppender.readTimeout=15000
appender.RelpAppender.reconnectInterval=3000
appender.RelpAppender.useSD=true

logger.RelpAppender.name=RelpAppender
logger.RelpAppender.level=debug
logger.RelpAppender.appenderRef.RelpAppender.ref=RelpAppender

rootLogger.level=debug
rootLogger.appenderRef.stdout.ref=RelpAppender
log4j2.shutdownHookEnabled=false

JLA_06 specific property explanations

Property Description

appender.RelpAppender.relpAddress

Connection destination address

appender.RelpAppender.relpPort

Connection destination port

appender.RelpAppender.appName

Stream application identifier. Maximum length of 48 characters, limited by RFC5424

appender.RelpAppender.hostname

Stream host identifier. Maximum length of 255 characters, limited by RFC5424

appender.RelpAppender.connectionTimeout

Time to wait before timing out connection

appender.RelpAppender.writeTimeout

Time to wait for destination to accept data

appender.RelpAppender.readTimeout

Time to wait for destination to acknowledge sent data (low values cause duplicates)

appender.RelpAppender.reconnectInterval

Time to wait between re-connection attempts

appender.RelpAppender.useSD

Enables structured data containing uuid and source information

Maven dependency definition

<dependency>
    <groupId>com.teragrep</groupId>
    <artifactId>jla_06</artifactId>
    <version>%VERSION%</version>
</dependency>

Configuring pre-built log4j2 application

First download wanted versions of jla_06, rlp_01 and syslog-java-client from the following urls:

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

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.