Install and Configure Kuda
Install
Install the Kuda by adding the following dependency:
<dependency>
<groupId>com.n1netails</groupId>
<artifactId>n1netails-kuda</artifactId>
<version>0.2.0</version>
</dependency>
Configure
Requirements
Set up and have the n1netails-api
running on your server.
- N1netails-Api README
In order to get started with Kuda all you need to do is add the following three lines of code.
// your n1netails-api location. For localhost use http://localhost:9901
TailConfig.setApiUrl("https://app.n1netails.com");
// your n1ne token (created by the n1netails user interface or api)
TailConfig.setN1neToken("n1ne-token-uuid");
// send your first tail
Tail.error("Testing kuda error").withTag("env", "prod").send();
⚠️ Note: If you do not configure the TailConfig
then Kuda will log a single warning about missing configurations and default to simple logging.
TailConfig
Example of using TailConfig to set the N1ne token, API url and path.
import com.n1netails.n1netails.kuda.internal.TailConfig;
public class ExampleService {
public ExampleService() {
// You can configure this anywhere must be set once.
TailConfig.setApiUrl("https://app.n1netails.com");
// (Optional) set a custom path to send the alerts. If not set it will default to `/ninetails/alert`
TailConfig.setApiPath("/ninetails/alert");
// Set the n1ne token value generated by n1netails api. If you are using n1netails-kuda for your own alerting api this value is optional.
TailConfig.setN1neToken("79dd8985-2d85-4a22-bfa0-0d70e963d713");
}
}