All Collections
Send your logs
Coralogix Logback integration
Coralogix Logback integration

A Coralogix Logback appender for easy integration into your Java logs

Eldar Aliiev avatar
Written by Eldar Aliiev
Updated over a week ago

To Download the 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.

Logback appender:

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration debug=”true”>
<appender name=”coralogix” class=”com.coralogix.sdk.appenders.CoralogixLogbackAppender”>
<companyId>*insert your company ID*</companyId>
<privateKey>*Insert your company private key*</privateKey>
<applicationName>*Insert desired Application name*</applicationName>
<subsystemName>*Insert desired Subsystem name*</subsystemName>
<mdc>firstKeyName,secondKeyName,thirdKeyName</mdc> *optional field*
</appender>
<root level=”debug”>
<appender-ref ref=”coralogix”/>
<appender-ref ref=”YOUR_LOGGER”/>
<appender-ref ref=”YOUR_LOGGER2″/>
</root>
</configuration>

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

Did this answer your question?