Search in sources :

Example 1 with ContextBuilderHelper

use of io.sentry.event.helper.ContextBuilderHelper in project zhcet-web by zhcet-amu.

the class SentryFactory method createSentryClient.

@Override
public SentryClient createSentryClient(Dsn dsn) {
    SentryClient sentryClient = new SentryClient(createConnection(dsn), getContextManager(dsn));
    /* Create and use the ForwardedAddressResolver, which will use the
           X-FORWARDED-FOR header for the remote address if it exists. */
    ForwardedAddressResolver forwardedAddressResolver = new ForwardedAddressResolver();
    sentryClient.addBuilderHelper(new HttpEventBuilderHelper(forwardedAddressResolver));
    sentryClient.addBuilderHelper(new ContextBuilderHelper(sentryClient));
    return configureSentryClient(sentryClient, dsn);
}
Also used : HttpEventBuilderHelper(io.sentry.event.helper.HttpEventBuilderHelper) ForwardedAddressResolver(io.sentry.event.helper.ForwardedAddressResolver) SentryClient(io.sentry.SentryClient) ContextBuilderHelper(io.sentry.event.helper.ContextBuilderHelper)

Aggregations

SentryClient (io.sentry.SentryClient)1 ContextBuilderHelper (io.sentry.event.helper.ContextBuilderHelper)1 ForwardedAddressResolver (io.sentry.event.helper.ForwardedAddressResolver)1 HttpEventBuilderHelper (io.sentry.event.helper.HttpEventBuilderHelper)1