Reputation: 3547
How does the loading of the logback.xml file work? specifically, when is it loaded?
I see all over the web this explanation:
But with no mention on when it is loaded. Is it on the first call to a logging statement?
Upvotes: 7
Views: 1625
Reputation: 27490
Logback-clasic initiailization occurs on the first call to the getILoggerFactory()
method in org.slf4j.LoggerFactory
. This method is indirectly invoked by the LoggerFactory.getLogger()
method. Thus, in practice, logback-clasic initiailization will occur on the first call to LoggerFactory.getLogger()
.
Upvotes: 5