Details
-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
-
1.3.0-alpha0
-
Any
Description
We have a use case where it is very useful to allow ContextSelectorStaticBinder to discover the logback.ContextSelector from the environment properties as opposed to the System properties. It comes up when you have multiple apps running in the same container and need to specify an alternate ContextSelector for only one of the apps, whereas the System property would affect all apps (and the container itself). The patch is trivial and is attached to this issue. Basically, in ContextSelectorStaticBinder.init(), instead of:
String contextSelectorStr = OptionHelper.getSystemProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR);
The patch does:
String contextSelectorStr = OptionHelper.getEnv(ClassicConstants.LOGBACK_CONTEXT_SELECTOR);
if (contextSelectorStr == null) {
contextSelectorStr = OptionHelper.getSystemProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR);
}
The patch can be applied to 1.2.4-SNAPSHOT (is that a thing?) or 1.3.0-SNAPSHOT, the ContextSelectorStaticBinder is the same in both.
Thank you!