Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export CORALOGIX_PRIVATE_KEY="YOUR_CORALOGIX_PRIVATE_KEY"
java -jar target/coralogix-sdk-example-1.0-SNAPSHOT.jar
```


## Extend

To use **Coralogix Java SDK** in your application you should add the appropriate dependency to your `pom.xml` file:
Expand All @@ -42,4 +43,19 @@ To use **Coralogix Java SDK** in your application you should add the appropriate
</dependency>
```

where `2.0.x` should be replaced with the latest version from the [Maven](https://mvnrepository.com/artifact/com.coralogix.sdk/coralogix-sdk) repository.
where `2.0.x` should be replaced with the latest version from the [Maven](https://cgx.jfrog.io/ui/native/maven/com/coralogix/sdk) repository.


## Build with Gradle

To build the project you need to execute the following command:

```bash
# if you have gradle installed
gradle build

# if gradle is not installed, docker ca
docker run --rm -u gradle -v "$PWD":/home/gradle/sdk-java-example -w /home/gradle/sdk-java-example gradle gradle build
```

After compilation you will have `build/libs/` folder which will contain the `.jar` file with the test application.
28 changes: 28 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.0'
}

repositories {
mavenCentral()
maven {
url "https://cgx.jfrog.io/artifactory/maven/"
}
}

dependencies {
implementation 'com.coralogix.sdk:log4j2-appender:2.0.10'
}

mainClassName = 'com.coralogix.sdk.ExampleApp'

application {
mainClassName = 'com.coralogix.sdk.ExampleApp'
}

shadowJar {
manifest {
attributes 'Main-Class': 'com.coralogix.sdk.ExampleApp'
}
}
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
<name>coralogix-sdk-example</name>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>coralogix-repository</id>
<url>https://cgx.jfrog.io/artifactory/maven</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.coralogix.sdk</groupId>
<artifactId>coralogix-sdk</artifactId>
<version>2.0.6</version>
<version>2.0.11</version>
</dependency>
</dependencies>
<build>
Expand All @@ -41,4 +49,4 @@
</plugin>
</plugins>
</build>
</project>
</project>