Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.7 KB

README.md

File metadata and controls

51 lines (40 loc) · 1.7 KB

Axiom Appender

This custom logback appender sends logs to Axiom. It was built and tested with Logback-Core version 1.2.3 and relies on logstash-logback-encoder version 7.2. Requires Java 11.

Getting Started

To get started, you'll need to add this library as a dependency via Maven/Gradle.

With Gradle:

dependencies {
    implementation('io.github.yhsj:axiom-appender:1.0.2')
}

repositories {
    mavenCentral() 
}

logback.xml Example Configuration

<configuration>
    <appender name="axiom" class="io.github.yhsj.axiom.AxiomAppender">
        <endpointUrl>The Endpoint URL</endpointUrl>
        <apiToken>your API Token</apiToken>
        <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
    </appender>

    <root level="debug">
        <appender-ref ref="axiom"/>
    </root>
</configuration>

Parameters

Parameter Default Explained Required
endpointUrl None The endpoint URL for your axiom Dataset. Can be found after creating a new Dataset and going to "stream" TRUE
apiToken None The API Token you've created for your Axiom account. This can be found, or generated, under "settings" and "API Tokens" TRUE

Example Usage

public class Main {
    
    private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
    
    public static void main(String[] args) {
        LOGGER.info("Hello World!");
    }
}