-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathSentryServletContainerInitializer.java
More file actions
32 lines (28 loc) · 1.1 KB
/
SentryServletContainerInitializer.java
File metadata and controls
32 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package io.sentry.servlet;
import com.jakewharton.nopen.annotation.Open;
import io.sentry.SentryIntegrationPackageStorage;
import java.util.Set;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Servlet container initializer used to add the {@link SentryServletRequestListener} to the {@link
* ServletContext}.
*/
@Open
public class SentryServletContainerInitializer implements ServletContainerInitializer {
static {
SentryIntegrationPackageStorage.getInstance()
.addPackage("maven:io.sentry:sentry-servlet", BuildConfig.VERSION_NAME);
}
@Override
public void onStartup(@Nullable Set<Class<?>> c, @NotNull ServletContext ctx)
throws ServletException {
ctx.addListener(SentryServletRequestListener.class);
SentryIntegrationPackageStorage.getInstance().addIntegration("Servlet");
SentryIntegrationPackageStorage.getInstance()
.addPackage("maven:io.sentry:sentry-servlet", BuildConfig.VERSION_NAME);
}
}