DOCUMENTATION

Java

See the basic setup steps below to get started with the Logify Alert service:

Generate an API Key

The Logify Alert service uses unique identifiers – API keys – to register and monitor individual applications. You will use this key later when creating an instance of Logify Alert client in code.

  1. Log in to the Logify Alert website: logify.devexpress.com.

  2. Switch to the Applications tab and click Create New Application.

  3. Specify the application name and description, then click Create.

  4. The Applications tab will now display a new entry with an auto-generated API key.

Send Reports to Logify Alert

This section explains how to make your Java application send unhandled exceptions to the Logify Alert service.

Add the Logify Alert Client to Your Project

In the pom.xml file, do the following:

  1. In the dependencies section, declare the logify-alert-java library dependency:

    <dependency>
      <groupId>com.devexpress.logify</groupId>
      <artifactId>logify-alert-java</artifactId>
      <version>1.0.2</version>
    </dependency>

  2. In the repositories section, declare the Logify Alert's maven repository:

    <repository>
      <id>any-name-or-id</id>
      <url>https://github.com/DevExpress/Logify.Alert.Clients/raw/maven </url>
    </repository>
    

In the build.gradle file, do the following:

  1. In the dependencies section, declare the logify-alert-java library dependency:

    compile "com.devexpress.logify:logify-alert-java:1.0.2"

  2. In the repositories section, declare the Logify Alert's maven repository:

    maven {
        url "https://github.com/DevExpress/Logify.Alert.Clients/raw/maven"
    }
    

Synchronize your project.

Send Reports Automatically

Initialize and configure the Logify Alert client to automatically intercept all unhandled exceptions and send the corresponding crash reports to Logify Alert:

import com.devexpress.logify.alert.java.LogifyAlert;

// Initialize the Logify Alert client.
LogifyAlert client = LogifyAlert.getInstance();
        
// Specify an API Key to register your application in the Logify Alert service.        
client.setApiKey("YOUR_API_KEY");

// Report unhandled exceptions to Logify Alert.
client.startExceptionsHandling();

Alternatively, you can specify an API Key in the logify.properties file:

apiKey=YOUR_API_KEY

Send Reports Manually

Use the following code to catch exceptions and send reports manually.

import com.devexpress.logify.alert.java.LogifyAlert;

try {
    // Some code
}
catch (Throwable ex){
    LogifyAlert client = LogifyAlert.getInstance();
    client.setApiKey("YOUR_API_KEY");
    client.send(e);
}

Rebuild and Run Your Application

Once your updated application has been redeployed, log in to logify.devexpress.com to review and process incoming reports.

Integration with Logging Tools

Logify Alert can automatically record crash reports in your project’s centralized log when using the following logging services:

Terms of use Copyright © 2016-2019 Developer Express Inc.