Environments
Auralog groups logs by the environment string you pass to AuralogConfig.builder().environment(...). Use distinct values per deployment so the dashboard can filter cleanly.
Auralog.init(AuralogConfig.builder() .apiKey(System.getenv("AURALOG_API_KEY")) .environment(System.getenv().getOrDefault("APP_ENV", "dev")) .build());Local development
Section titled “Local development”For local dev, consider raising flushInterval or disabling captureErrors to reduce noise:
Auralog.init(AuralogConfig.builder() .apiKey("aura_dev_key") .environment("dev") .flushInterval(Duration.ofSeconds(30)) .captureErrors(false) .build());Testing
Section titled “Testing”Tests usually want the SDK inert. Either:
- Skip
Auralog.init()— callingAuralog.info(...)without init throwsIllegalStateException("Auralog.init(config) must be called before logging"). Catch or guard in test scope. - Point at a mock endpoint — use
endpoint("http://localhost:1"); sends will fail fast and silently (network errors are swallowed).
Example JUnit 5 setup:
@BeforeAllstatic void auralogInit() { Auralog.init(AuralogConfig.builder() .apiKey("test") .environment("test") .endpoint("http://localhost:1") .captureErrors(false) .build());}
@AfterAllstatic void auralogShutdown() { Auralog.shutdown();}Serverless / short-lived processes
Section titled “Serverless / short-lived processes”For AWS Lambda, Google Cloud Run jobs, scheduled containers, etc.: call Auralog.shutdown() at the end of your handler to guarantee a flush before the process is frozen or terminated.
public class Handler implements RequestHandler<Input, Output> { @Override public Output handleRequest(Input event, Context context) { try { return doWork(event); } finally { Auralog.shutdown(); } }}The auto-registered shutdown hook also fires at interpreter exit, so this is belt-and-braces — but explicit shutdown is faster and more deterministic in serverless contexts.
GraalVM native-image
Section titled “GraalVM native-image”The SDK ships reachability metadata for GraalVM under META-INF/native-image/ai.auralog/auralog-core/. Spring Boot 3 + native builds work without additional configuration.