I'm trying to split logs based on a System property that changes dynamically
at runtime.Is the below Discriminator code the way to go?Will this
Discriminator get called for every log statement?
import ch.qos.logback.classic.spi.ILoggingEvent;import
ch.qos.logback.core.sift.AbstractDiscriminator;public class
SysPropDiscriminator extends AbstractDiscriminator { private static final
String KEY = "PROP"; @Override public String
getDiscriminatingValue(ILoggingEvent event) { String propValue =
System.getProperty("my.property"); if (propValue == null ||
propValue.length() == 0) { return "unknown"; } else {
return propValue; } } @Override public String getKey() {
return KEY; }}
--
View this message in context:
http://logback.10977.n7.nabble.com/System-property-based-Discriminator-tp14750.html
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
logback-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-user