we are already using sentry self-hosted, just not yet for java (EE)
I’m looking at this example in regards to triggering events.
try {
int example = 1 / 0;
} catch (Exception e) {
logger.error("Caught exception!", e);
}
I’m sure this is more of a java question rather than a sentry(sdk) version but ; what if an error happens and is not sent to logger.error()?
Is it sent to sentry?
The problem is that all code blocks are not ‘equipped’ with try/catch blocks and subsequently with logger.error()…how do these errors arrive to sentry?
Shoud, in this case/configuration, uncaught exceptions also be caught? I can verify that, if ‘pushed’ trough logger.error(), the error is shown in Sentry. But uncaught (the same mistake) isn’t.
Should I explicitly install ‘sentry’ through maven?
It’s been a while since I worked with JBoss but as far as I can tell: either you need to catch the exception (in case you use JAX-RS take a look here how this can be done) or you need to configure JBoss to use log4j2 and configure SentryAppender there. You may find this guide useful.
Keep in mind that sentry-java master is a base for 3.0 version which is very different from the 1.7.x that you are likely using (?).
In both cases, SDK comes with a Sentry appender that must be configured - either in application or in the application server. Is this unhandled exception logged using log4j2 configured in your application, or is it logged with loggers managed by JBoss?
We need a lot more information to be able to answer this question. Are you using a self-hosted Sentry (I think you do based on your initial message)? Then have you checked its logs to see if the events are actually getting to your Sentry instances? If that’s the case do all workers and services run properly?
It uses ‘sentry 1.7.5’. Last version of 1.7 branch is 1.7.30 and the latest is 3.0.0. Would it be possible to update this example with version 3.0.0?
It would be nice if the example would also have an example of uncaught exception.
If it won’t solve your issue - provide please more information about your application. Do you configure Sentry appender in the application or on the application server level? Is it a Java EE application or Spring or something else? If you could provide a minimal example that I could just take and deploy to JBoss it would help me finding an issue.