All SDKs
Log4j 2.x
vio.sentry:sentry-log4j2
Use the official Sentry SDK with the DSN shown in your AllStak project setup. No AllStak-specific SDK is required.
Install
These official Sentry commands come from the AllStak-managed SDK catalog.
maven
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-log4j2</artifactId>
</dependency>gradle
implementation("io.sentry:sentry-log4j2")Quick start
import io.sentry.Sentry;
Sentry.init(options -> {
options.setDsn("{{DSN}}");
options.setEnvironment("production");
options.setRelease("[email protected]");
options.setTracesSampleRate(1.0);
// Off by default. Enable only if you accept sending usernames,
// emails and IP addresses to your telemetry backend.
options.setSendDefaultPii(false);
});
Sentry.captureException(new RuntimeException("hello from sentry-java"));