@@ -322,9 +322,9 @@ private static void init(final @NotNull SentryOptions options, final boolean glo
322322 final IScope rootIsolationScope = new Scope (options );
323323 rootScopes = new Scopes (rootScope , rootIsolationScope , globalScope , "Sentry.init" );
324324
325+ initLogger (options );
325326 initForOpenTelemetryMaybe (options );
326327 getScopesStorage ().set (rootScopes );
327-
328328 initConfigurations (options );
329329
330330 globalScope .bindClient (new SentryClient (options ));
@@ -348,6 +348,19 @@ private static void init(final @NotNull SentryOptions options, final boolean glo
348348 finalizePreviousSession (options , ScopesAdapter .getInstance ());
349349
350350 handleAppStartProfilingConfig (options , options .getExecutorService ());
351+
352+ options
353+ .getLogger ()
354+ .log (SentryLevel .DEBUG , "Using openTelemetryMode %s" , options .getOpenTelemetryMode ());
355+ options
356+ .getLogger ()
357+ .log (
358+ SentryLevel .DEBUG ,
359+ "Using span factory %s" ,
360+ options .getSpanFactory ().getClass ().getName ());
361+ options
362+ .getLogger ()
363+ .log (SentryLevel .DEBUG , "Using scopes storage %s" , scopesStorage .getClass ().getName ());
351364 } else {
352365 options
353366 .getLogger ()
@@ -359,6 +372,7 @@ private static void init(final @NotNull SentryOptions options, final boolean glo
359372 }
360373
361374 private static void initForOpenTelemetryMaybe (SentryOptions options ) {
375+ OpenTelemetryUtil .updateOpenTelemetryModeIfAuto (options , new LoadClass ());
362376 if (SentryOpenTelemetryMode .OFF == options .getOpenTelemetryMode ()) {
363377 options .setSpanFactory (new DefaultSpanFactory ());
364378 // } else {
@@ -367,7 +381,13 @@ private static void initForOpenTelemetryMaybe(SentryOptions options) {
367381 // NoOpLogger.getInstance()));
368382 }
369383 initScopesStorage (options );
370- OpenTelemetryUtil .applyIgnoredSpanOrigins (options , new LoadClass ());
384+ OpenTelemetryUtil .applyIgnoredSpanOrigins (options );
385+ }
386+
387+ private static void initLogger (final @ NotNull SentryOptions options ) {
388+ if (options .isDebug () && options .getLogger () instanceof NoOpLogger ) {
389+ options .setLogger (new SystemOutLogger ());
390+ }
371391 }
372392
373393 private static void initScopesStorage (SentryOptions options ) {
@@ -505,16 +525,9 @@ private static boolean preInitConfigurations(final @NotNull SentryOptions option
505525
506526 @ SuppressWarnings ("FutureReturnValueIgnored" )
507527 private static void initConfigurations (final @ NotNull SentryOptions options ) {
508- ILogger logger = options .getLogger ();
509-
510- if (options .isDebug () && logger instanceof NoOpLogger ) {
511- options .setLogger (new SystemOutLogger ());
512- logger = options .getLogger ();
513- }
528+ final @ NotNull ILogger logger = options .getLogger ();
514529 logger .log (SentryLevel .INFO , "Initializing SDK with DSN: '%s'" , options .getDsn ());
515530
516- OpenTelemetryUtil .applyIgnoredSpanOrigins (options , new LoadClass ());
517-
518531 // TODO: read values from conf file, Build conf or system envs
519532 // eg release, distinctId, sentryClientName
520533
0 commit comments