impl sentry
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Has been cancelled

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> <artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency> </dependency>
<!-- Sentry -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.27</version>
</dependency>
<!-- InfluxDB Metrics --> <!-- InfluxDB Metrics -->
<dependency> <dependency>
<groupId>com.influxdb</groupId> <groupId>com.influxdb</groupId>

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