Description
Currently SLF4J (1.8+) uses ServiceLoader to find providers; as an improvement for performance sensitive (or otherwise restricted) environments allow the provider to be explicitly specified.
For example:
-Dslf4j.provider=ch.qos.logback.classic.spi.LogbackServiceProvider
In the event this property isn't specified then logic could fall-through to existing ServiceLoader behavior.
Examples of where this would be valuable:
1) Cloud functions sensitive to cold-start times (e.g. AWS Lambda). Avoiding scanning the classpath reduces startup time (and hence request processing time for requests incurring a cold start). This is the my use case.
2) Class-loader challenged environments where ServiceLoader may not behave as expected; specifying the precise class to load may allow for workarounds.
Attachments
Issue Links
- is duplicated by
-
SLF4J-592 Mechanism for indicating provider to use for unit tests.
- Resolved