Skip to content

Commit edefd3d

Browse files
avoid failing on noop slf4j factory
1 parent 7b07616 commit edefd3d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

otoroshi/app/OtoroshiLoader.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ import java.util.concurrent.atomic.AtomicReference
2929
class OtoroshiLoader extends ApplicationLoader {
3030

3131
def load(context: Context): Application = {
32-
LoggerConfigurator(context.environment.classLoader).foreach {
33-
_.configure(context.environment, context.initialConfiguration, Map.empty)
32+
LoggerConfigurator(context.environment.classLoader).foreach { lc =>
33+
if (lc.loggerFactory.getClass.getName != "org.slf4j.helpers.NOPLoggerFactory") {
34+
lc.configure(context.environment, context.initialConfiguration, Map.empty)
35+
}
3436
}
3537
val components = new OtoroshiComponentsInstances(context, None, None, false)
3638
OtoroshiLoaderHelper.initOpenTelemetryLogger(context.initialConfiguration, components.env)

0 commit comments

Comments
 (0)