Improve handling of logback configuration files in IDEs

Description

Even if we take care to not include logback configuration files in jars and test jars, IDEs such as IntelliJ still end up mixing more than one config file in the classpath of tests, which results in log messages not being shown. Instead we usually see this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 11:03:32,755 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [file:/Users/alexandredutra/Projects/java-dse-driver-2.x/integration-tests/target/test-classes/logback-test.xml] 11:03:32,757 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs multiple times on the classpath. 11:03:32,757 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs at [file:/Users/alexandredutra/Projects/java-dse-driver-2.x/integration-tests/target/test-classes/logback-test.xml] 11:03:32,757 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs at [file:/Users/alexandredutra/Projects/java-dse-driver-2.x/core/target/test-classes/logback-test.xml] 11:03:32,757 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs at [file:/Users/alexandredutra/Projects/java-oss-driver-4.x/integration-tests/target/test-classes/logback-test.xml] 11:03:32,856 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set 11:03:32,857 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] 11:03:32,871 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT] 11:03:32,881 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property 11:03:32,960 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR 11:03:32,960 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT] 11:03:32,963 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.directory] to ERROR 11:03:32,963 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.datastax.oss.driver] to ERROR 11:03:32,964 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.datastax.dse.driver] to ERROR 11:03:32,964 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.ops4j] to ERROR 11:03:32,964 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration. 11:03:32,965 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@1b7cc17c - Registering current configuration as safe fallback point

Explicitly setting the location of the configuration file to use should help fixing this issue in a non-intrusive way.

Environment

None

Pull Requests

None

Status

Assignee

Alexandre Dutra

Reporter

Alexandre Dutra

Labels

None

PM Priority

None

Reproduced in

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Fix versions

Priority

Minor