English 中文(简体)
页: 1 X 简单地说不可行
原标题:Sentry in Spring 1.X simply does not work

We have a spring 1.5.17 app and are trying to simply integrate Sentry. Because this is an older version of Spring (no, upgrading isn t a possibility), we re following Sentry s Legacy SDK 1.7 directions here. It s quite straightforward.

Configuration

页: 1 我们使用其他春天图书馆,如伐木/开工/jpa,但并未表现出清晰度。 所有相同的春季版本。

<dependency>
    <groupId>io.sentry</groupId>
    <artifactId>sentry-spring</artifactId>
    <version>1.7.30</version>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <version>1.5.17.RELEASE</version>
</dependency>

Additionally, added sentry.properties file under src/main/resources.

enabled=true
dsn=***
environment=uat
sample.rate=1.0
stacktrace.app.packages=com.pls
stacktrace.hidecommon=false

Application

创建了一个碎块组合文件,记录每张entry子上写两具。

@Configuration
public class SentryConfig {

    @Bean
    public HandlerExceptionResolver sentryExceptionResolver() {
        return new io.sentry.spring.SentryExceptionResolver();
    }

    @Bean
    public ServletContextInitializer sentryServletContextInitializer() {
        return new io.sentry.spring.SentryServletContextInitializer();
    }
}

Via breakpoints, I ve confirmed that these beans are initializing and they are getting the properties from sentry.properties correctly. A related thread, I found that if I manually make SentryClient.captureEvent(event) calls, then events show up in sentry. This means that the sentry client is setup correctly and working, but spring isn t actually ever calling .captureEvent().

为了证实我的怀疑,我进入了SenterExceptionResolver bean,并确认该法典从未打过这一突破点。

“在座的影像描述”/</a

I ve试图通过在@RestController上投掷 du错误而触发点。

@GET
@Path("/test")
public Object throwError(){
  LOGGER.error("ERROR BEING LOGGED");
  throw new RuntimeException("ERROR THROWN");
}

While this error is certainly thrown in the console logs, it does NOT trigger the .capture() codepath.

Logging?

, 相关<提到了一些带有伐木模块的内容,但我不理解这种关联。

不管怎样,我尝试增加各种伐木附属物(例如:www.logback assection in this senter doc)。 我的组合可能没有什么东西!

如果是这样的话,我们确实使用开端log-博客......

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-logging</artifactId>
</dependency>

请注意,当我添加<条码> 填入-logback 依附时,该装货箱就装了。

“enterography

最佳回答

看来,你正在使用日本宇宙航空研究开发机构,而不是春天航天中心。 没有任何日本宇宙航空研究开发公司-RS——在盒子外进行重返大气层。

为向Senter提出例外,您也可使用<代码> 入门-logback集成。 您可以将伐木错误移至Senter。 也没有春天融合的缺点是,错误与吉大港山区倡议要求提供的背景信息没有关系。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签