What is Sentry
Sentry is a crash reporting platform that provides you with "real-time insight into production deployments with info to reproduce and fix crashes". It notifies you of exceptions or errors that your users run into while using your app, and organizes them for you on a web dashboard.
Why add to a RSPS
Simple reason to catch errors your players may fail to report to you. This will help you identify info that players may sometimes not send. And give you Info about what build it started, how many people it has crashed / shown for, and what Conditions.
Example
Step 1: Make an Account
Go to: https://sentry.io/
Follow the steps on the screen once you get to this page
Take note of your dsn as this is important
Carry on following the steps, once you have sent the first error to show its working, we can now move onto step 2
Step 2: Prepping the Server and Client
The first thing you want to make sure you have done is import the Library using your build system. In my case, its Gradle so it looks like this
Go to your main method where your Server launches from and right at the top add the following
Tags - Adding more
Code:
option.setTag(name,value);
Within this you can add any extra info you want to send with your crash / error report
Catching the Errors
For this you will need some kind of Logging lib like SLF4J Once you have this on your project in Resources [EG: Client/src/main/resources/logback.xml] make a file called logback.xml.
This is an example of my logback
Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %class{0} - %msg%n</Pattern>
</encoder>
</appender>
<!-- Configure the Sentry appender, overriding the logging threshold to the WARN level -->
<appender name="Sentry" class="io.sentry.logback.SentryAppender">
<options>
<!-- NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry project/dashboard -->
<dsn>https://[email protected]/0</dsn>
</options>
<minimumEventLevel>ERROR</minimumEventLevel>
<minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/.client/logs/client.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${user.home}/.client/logs/client_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<!-- keep 30 days' worth of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %class{0} - %msg%n</Pattern>
</encoder>
</appender>
<root level="ERROR">
<appender-ref ref="Sentry" />
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
Feel free to edit these to what will suit you the best.
Explore
That's it Sentry is now setup to see more Options that Sentry have please check
https://getsentry.github.io/sentry-j...ryOptions.html
Originally Posted by
Jay Gatsby
For reference, you can get a paid Sentry account with the GitHub student package which some users might have access to