Skip to content

Instantly share code, notes, and snippets.

@kazuki-ma
Last active August 17, 2018 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazuki-ma/486fdd197c226eddb35f1e104791ea87 to your computer and use it in GitHub Desktop.
Save kazuki-ma/486fdd197c226eddb35f1e104791ea87 to your computer and use it in GitHub Desktop.
Java でロガーを SLF4J に統一する冴えたやり方 ref: https://qiita.com/kazuki-ma/items/13c426e4dccf5cc4d843
configurations.all {
exclude
}
dependencies {
// Used compile/coding time.
compile 'org.slf4j:slf4j-api:1.7.25'
// Used Runtime
runtime 'ch.qos.logback:logback-classic:1.2.3' // The log implementation.
runtime 'org.slf4j:jcl-over-slf4j:1.7.25' // Commons-Logging > SLF4J
runtime 'org.slf4j:jul-to-slf4j:1.7.25' // Java Util Logging > SLF4J
runtime 'org.apache.logging.log4j:log4j-to-slf4j:2.11.0' // Log4j 1&2 > SLF4J
}
configurations.all {
exclude group: 'log4j' // = Log4j implementation.
exclude module: 'log4j-slf4j-impl' // = SLF4J > Log4J Implementation. (Apache Side)
exclude module: 'slf4j-log4j12' // = SLF4J > Log4J Implementation. (SLF4J Side)
exclude module: 'log4j-over-slf4j' // = Old Log4j 1&2 > SLF4J
exclude module: 'slf4j-jdk14' // = SLF4J > JDK14 Binding
exclude module: 'commons-logging' // Because bridged by jcl-over-slf4j
exclude module: 'commons-logging-api' // Replaced by jcl-over-slf4j
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment