Replies: 1 comment
-
Closing this as we injected LoggerConfiguration through a boot and that fixed it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
we have long configured to run LoggerConfigurator as early as Play suggests. However, after upgrading to Play 2.9, the loading of logging configuration somehow happens after other object instantiation (the creation of a cache in specific), this caused some logging to be logged at DEBUG level because the loading of logback.xml wasn't happened yet.
Wonder if there's any way to enforce LoggerConfigurator to be run before anything else?
Code snippet:
class ABCPlayApplicationLoader extends ApplicationLoader {
override def load(context: Context): Application = {
new BuiltInComponentsFromContext(context)
with CachesBoot
{
}
Logs: The loading order are highlighted in bold
11:00:35.555 [main] DEBUG net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl -- Mocking Operation Statistic: XA_ROLLBACK
11:00:35.556 [main] DEBUG net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl -- Mocking Operation Statistic: XA_RECOVERY
11:00:35.557 [main] DEBUG net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl -- Mocking Operation Statistic: CLUSTER_EVENT
11:00:35.557 [main] DEBUG net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl -- Mocking Operation Statistic: NONSTOP
11:00:35.561 [main] DEBUG net.sf.ehcache.Cache -- Initialised cache: abcDataCache
11:00:35.562 [main] DEBUG abc.xyz.cache.echcache.Ehcache -- Adding to registeredEhCache abcDataCache
11:00:35.638 [Arch-ActorSystem-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger -- Slf4jLogger started
11:00:35.710 [Arch-ActorSystem-akka.actor.default-dispatcher-6] INFO cinnamon.akka.stream.CinnamonAkkaStreamInstrumentation -- Created MessageClassFormatter [cinnamon.akka.message-class-to-simple-name]
11:00:35.713 [Arch-ActorSystem-akka.actor.default-dispatcher-6] INFO cinnamon.slf4j.mdc.MdcAlpakkaKafkaInstrumentation -- Created MdcPropagation [cinnamon.slf4j.mdc.alpakka.kafka.encoded-header]
11:00:35.725 [Arch-ActorSystem-akka.actor.default-dispatcher-6] INFO cinnamon.akka.stream.CinnamonAkkaStreamInstrumentation -- Created MessageClassFormatter [cinnamon.akka.message-class-to-simple-name]
11:00:35.728 [Arch-ActorSystem-akka.actor.default-dispatcher-6] INFO cinnamon.slf4j.mdc.MdcAlpakkaKafkaInstrumentation -- Created MdcPropagation [cinnamon.slf4j.mdc.alpakka.kafka.encoded-header]
11:00:35.730 [Arch-ActorSystem-akka.actor.default-dispatcher-6] INFO cinnamon.akka.stream.CinnamonAkkaStreamInstrumentation -- Created MessageClassFormatter [cinnamon.akka.message-class-to-simple-name]
11:00:35.735 [Arch-ActorSystem-akka.actor.default-dispatcher-6] INFO cinnamon.slf4j.mdc.MdcAlpakkaKafkaInstrumentation -- Created MdcPropagation [cinnamon.slf4j.mdc.alpakka.kafka.encoded-header]
11:00:31,950 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.5.6
11:00:31,953 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - No custom configurators were discovered as a service.
11:00:31,953 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - Trying to configure with ch.qos.logback.classic.joran.SerializedModelConfigurator
11:00:31,954 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - Constructed configurator of type class ch.qos.logback.classic.joran.SerializedModelConfigurator
11:00:31,956 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.scmo]
11:00:31,956 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.scmo]
11:00:31,961 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - ch.qos.logback.classic.joran.SerializedModelConfigurator.configure() call lasted 3 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
11:00:31,961 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - Trying to configure with ch.qos.logback.classic.util.DefaultJoranConfigurator
11:00:31,963 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - Constructed configurator of type class ch.qos.logback.classic.util.DefaultJoranConfigurator
11:00:31,964 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
11:00:31,964 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml]
11:00:31,964 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 1 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
11:00:31,964 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - Trying to configure with ch.qos.logback.classic.BasicConfigurator
11:00:31,967 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - Constructed configurator of type class ch.qos.logback.classic.BasicConfigurator
11:00:31,967 |-INFO in ch.qos.logback.classic.BasicConfigurator@780dbed7 - Setting up default configuration.
11:00:31,988 |-INFO in ch.qos.logback.classic.util.ContextInitializer@7f02b2d4 - ch.qos.logback.classic.BasicConfigurator.configure() call lasted 21 milliseconds. ExecutionStatus=NEUTRAL
11:00:35,894 |-WARN in ch.qos.logback.classic.joran.action.LevelAction - element is deprecated. Near [level] on line 68
11:00:35,894 |-WARN in ch.qos.logback.classic.joran.action.LevelAction - Please use "level" attribute within or elements instead.
11:00:35,937 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandlerFull - Registering a new ReconfigureOnChangeTask ReconfigureOnChangeTask(born:1723647635935)
11:00:35,937 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandlerFull - Will scan for changes in [file:/home/d-xyz/IdeaProjects/temp-app/temp-app-rest/conf/logback.xml] <---------------------------
11:00:35,937 |-INFO in ch.qos.logback.classic.model.processor.ConfigurationModelHandlerFull - Setting ReconfigureOnChangeTask scanning period to 5 seconds
11:00:35,942 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT]
11:00:35,942 |-INFO in ch.qos.logback.core.model.p
Beta Was this translation helpful? Give feedback.
All reactions