In a Spring Boot project I have a SentryConfig.java file
package example.services.bo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
@Configuration
public class SentryConfig {
@Bean
public HandlerExceptionResolver sentryExceptionResolver() {
return new io.sentry.spring.SentryExceptionResolver();
}
}
and a sentry.properties file:
dsn=http://123a98a06c844a85b34cdf0de1fcd114:abcc286fa2a846dcbc8334b3625bc7ac@sentry.example.com:9000/3
stacktrace.app.packages=example.services.bo
How I'll configure my Spring project to send user details to Sentry like, username and user id?
Edit:
@Configuration
public class SentryConfig {
@Bean
public HandlerExceptionResolver sentryExceptionResolver() {
Sentry.getContext().setUser(
new UserBuilder().setEmail("test@example.com").build()
);
return new io.sentry.spring.SentryExceptionResolver();
}
}
didn't help.