impl sentry

This commit is contained in:
Lee 2024-04-21 18:41:53 +01:00
parent beda7fa230
commit cca45057f0
2 changed files with 17 additions and 1 deletions

@ -129,6 +129,13 @@
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>
<!-- Sentry -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.27</version>
</dependency>
<!-- InfluxDB Metrics -->
<dependency>
<groupId>com.influxdb</groupId>

@ -2,6 +2,7 @@ package xyz.mcutils.backend;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.sentry.Sentry;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication;
@ -33,6 +34,14 @@ public class Main {
}
log.info("Found configuration at '{}'", config.getAbsolutePath()); // Log the found config
// Init Sentry
Sentry.init();
Sentry.init("https://631d4c96be4d48d1bd1b3ea612cbcee7@glitchtip.fascinated.cc/2");
try {
SpringApplication.run(Main.class, args); // Start the application
} catch(Exception ex) {
Sentry.capture(ex); // Capture the exception with Sentry
}
}
}