Coralogix log4j integration

To Download Coralogix SDK

See maven repository: http://mvnrepository.com/artifact/com.coralogix.sdk

Install:

Coralogix SDK jar is available on Maven Central Repository

Usage:

You must provide the following four variables when creating a Coralogix logger instance.

Company ID – A private key which is used to validate your authenticity, this key will be sent to your mail once you register to Coralogix and should not be transferred outside your company.

Private Key – A unique ID which represents your company, this Id will be sent to your mail once you register to Coralogix.

Application Name – The name of your main application, for example, a company named “SuperData” would probably insert the “SuperData” string parameter or if they want to debug their test environment they might insert the “SuperData– Test”.

SubSystem Name – Your application probably has multiple subsystems, for example: Backend servers, Middleware, Frontend servers etc. in order to help you examine the data you need, inserting the subsystem parameter is vital.

LOG4J-1 appender:


log4j.appender.CORALOGIX=com.coralogix.sdk.appenders.CoralogixLog4j1Appender 
log4j.appender.CORALOGIX.companyId=*insert your company ID* 
log4j.appender.CORALOGIX.privateKey=*Insert your company private key* 
log4j.appender.CORALOGIX.applicationName=*Insert desired Application name* 
log4j.appender.CORALOGIX.subsystemName=*Insert desired Subsystem name* 
log4j.rootLogger=DEBUG, CORALOGIX, YOUR_LOGGER, YOUR_LOGGER2, YOUR_LOGGER3

Note!: YOUR_LOGGER is another logger you have defined in your log4j configuration that you want to be defined on the rootLogger

LOG4J-2 APPENDER:


<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="com.coralogix.sdk.appenders">
<Appenders>
<Coralogix name="Coralogix" companyId="*insert your company ID*" privateKey="*Insert your company private key*" applicationName="*Insert desired Application name*" subSystemName="*Insert desired Subsystem name*">
</Coralogix>
</Appenders>
<Loggers>
<Root level="trace">
<AppenderRef ref="Coralogix"/>
<AppenderRef ref="YOUR_LOGGER"/>
<AppenderRef ref="YOUR_LOGGER2"/>
</Root>
</Loggers>
</Configuration>

Note!: YOUR_LOGGER is another logger you have defined in your log4j configuration that you want to be defined on the rootLogger

Need help? We love to assist our customers, simply book your implementation session, and we will walk you through, step by step.

Signup to Coralogix
WordPress Lightbox