We believe you should no be limited to application based file shippers.
So to support such cases where you want to integrate you application to Coralogix on the basic code level we provide easy to use SDKs.
Our SDKs will integrate with the basic logger functions and will also offer appenders support for Java.
You will need to add the Coralogix SDK to you projects build dependencies.
We support Maven repository.
And you can download our SDK from here
You are welcome to review our Java Sample Project repository
Parameter | Description |
---|---|
Private Key | The private key can be found under ‘settings’->’ send your logs’. |
Company ID | A unique ID that represents your company. The private key can be found under ‘settings’->’ send your logs’. |
Application Name | The application Tag you wish to append to every log line sent |
SubSystem Name | The subsystem Tag you wish to append to every log line sent |
If your Account is not in the EU region (the account url does not have a .com suffix)
you will need to add this environment variable:
CORALOGIX_LOG_URL=https://<coralogix_cluster_url>/api/v1/logs
Cluster location | coralogix_cluster_url |
---|---|
US | api.coralogix.us |
India | api.app.coralogix.in |
Singapore | api.coralogixsg.com |
import api.CoralogixLogger; //import the SDK public class logging { public static void main(String[] args) { String privateKey = "*insert the private key you received after signup*"; String appName = "*Insert desired Application name*"; String subSystem = "*Insert desired subsystem name*"; CoralogixLogger.configure(privateKey, appName, subSystem); //Create a connection object to Coralogix CoralogixLogger logger = new CoralogixLogger(logging.class.toString()); //Create a generic logger object which the Coralogix SDK logger.info("my info log"); //Test the log shipping } }
import com.coralogix.sdk.api.CoralogixLogger; //import the SDK import com.coralogix.sdk.api.CoralogixSDK; //import the SDK public class logging { public static void main(String[] args) throws Exception{ String privateKey = "*insert the private key you received after signup*"; int companyId = "*insert the company ID you received after signup*"; String appName = *companyId* + "*Insert desired Application name*"; String subsystem = "*Insert desired subsystem name*"; CoralogixLogger logger = CoralogixSDK.createAndConnectNewLogger(appName, subsystem, companyId, privateKey); //Create a connection object to Coralogix logger.sendCriticalLog("This is my serious test log 1"); //Test the log shipping } }