Switch to using slf4j/logback for logging.
We still compile modules against commons-logging but all runtime logging and samples will use logback
This commit is contained in:
parent
ed447f63f6
commit
69a10c48ae
|
@ -1,9 +0,0 @@
|
||||||
log4j.rootLogger=INFO, stdout
|
|
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=%p %c{1} - %m%n
|
|
||||||
|
|
||||||
log4j.logger.org.springframework.security=DEBUG
|
|
||||||
|
|
||||||
log4j.logger.org.apache.directory=ERROR
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<configuration>
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="org.apache.directory" level="WARN"/>
|
||||||
|
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
|
@ -9,13 +9,17 @@ apacheDsVersion = '1.5.5'
|
||||||
jstlVersion = '1.1.2'
|
jstlVersion = '1.1.2'
|
||||||
jettyVersion = '6.1.22'
|
jettyVersion = '6.1.22'
|
||||||
hsqlVersion = '1.8.0.10'
|
hsqlVersion = '1.8.0.10'
|
||||||
|
slf4jVersion = '1.6.1'
|
||||||
|
logbackVersion = '0.9.24'
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
provided
|
provided
|
||||||
compile.extendsFrom provided
|
compile.extendsFrom provided
|
||||||
|
compile.transitive = false
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// We only compile against commons logging. It is excluded from all other configurations
|
||||||
compile 'commons-logging:commons-logging:1.1.1'
|
compile 'commons-logging:commons-logging:1.1.1'
|
||||||
|
|
||||||
compile ("org.springframework:spring-core:$springVersion") {
|
compile ("org.springframework:spring-core:$springVersion") {
|
||||||
|
@ -29,8 +33,17 @@ dependencies {
|
||||||
'org.hamcrest:hamcrest-core:1.1',
|
'org.hamcrest:hamcrest-core:1.1',
|
||||||
'org.hamcrest:hamcrest-library:1.1',
|
'org.hamcrest:hamcrest-library:1.1',
|
||||||
"org.springframework:spring-test:$springVersion"
|
"org.springframework:spring-test:$springVersion"
|
||||||
|
|
||||||
|
// Use slf4j/logback for logging
|
||||||
|
testRuntime "org.slf4j:slf4j-api:$slf4jVersion",
|
||||||
|
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
||||||
|
"ch.qos.logback:logback-core:$logbackVersion",
|
||||||
|
"ch.qos.logback:logback-classic:$logbackVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get rid of commons logging
|
||||||
|
[configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
|
||||||
|
|
||||||
test {
|
test {
|
||||||
onlyIf {
|
onlyIf {
|
||||||
!project.hasProperty('skipTests')
|
!project.hasProperty('skipTests')
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Logging
|
|
||||||
#
|
|
||||||
|
|
||||||
log4j.rootLogger=WARN, stdout
|
|
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=[%p,%c{1}] %m%n
|
|
||||||
|
|
||||||
log4j.logger.org.springframework.security=WARN
|
|
||||||
log4j.logger.org.springframework.ldap=WARN
|
|
||||||
log4j.logger.org.apache.directory=ERROR
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<configuration>
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="org.apache.directory" level="WARN"/>
|
||||||
|
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
|
@ -2,24 +2,32 @@
|
||||||
|
|
||||||
test.exclude('**/OpenLDAPIntegrationTestSuite.class')
|
test.exclude('**/OpenLDAPIntegrationTestSuite.class')
|
||||||
|
|
||||||
|
apacheds_libs = [
|
||||||
|
"org.apache.directory.server:apacheds-core:$apacheDsVersion",
|
||||||
|
"org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
|
||||||
|
"org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
|
||||||
|
"org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
|
||||||
|
"org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
|
||||||
|
'org.apache.directory.shared:shared-ldap:0.9.15'
|
||||||
|
]
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':spring-security-core'),
|
compile project(':spring-security-core'),
|
||||||
"org.springframework:spring-beans:$springVersion",
|
"org.springframework:spring-beans:$springVersion",
|
||||||
"org.springframework:spring-context:$springVersion",
|
"org.springframework:spring-context:$springVersion",
|
||||||
"org.springframework:spring-tx:$springVersion",
|
"org.springframework:spring-tx:$springVersion",
|
||||||
"org.apache.directory.server:apacheds-core:$apacheDsVersion",
|
|
||||||
"org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
|
|
||||||
"org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
|
|
||||||
"org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
|
|
||||||
"org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
|
|
||||||
'org.apache.directory.shared:shared-ldap:0.9.15',
|
|
||||||
'ldapsdk:ldapsdk:4.1'
|
'ldapsdk:ldapsdk:4.1'
|
||||||
|
apacheds_libs.collect {
|
||||||
|
compile (it) {
|
||||||
|
exclude group: 'org.slf4j'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compile ("org.springframework.ldap:spring-ldap-core:$springLdapVersion") {
|
compile ("org.springframework.ldap:spring-ldap-core:$springLdapVersion") {
|
||||||
exclude(group: 'commons-logging', module: 'commons-logging')
|
exclude(group: 'commons-logging', module: 'commons-logging')
|
||||||
exclude(group: 'org.springframework', module: 'spring-core')
|
exclude(group: 'org.springframework', module: 'spring-core')
|
||||||
exclude(group: 'org.springframework', module: 'spring-tx')
|
exclude(group: 'org.springframework', module: 'spring-tx')
|
||||||
exclude(group: 'org.springframework', module: 'spring-beans')
|
exclude(group: 'org.springframework', module: 'spring-beans')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
runtime 'org.slf4j:slf4j-log4j12:1.4.3'
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
# Logging
|
|
||||||
#
|
|
||||||
|
|
||||||
log4j.rootLogger=INFO, stdout
|
|
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.stdout.layout.ConversionPattern=%p %c{1} - %m%n
|
|
||||||
|
|
||||||
log4j.logger.org.springframework.security=DEBUG
|
|
||||||
log4j.logger.org.springframework.ldap=DEBUG
|
|
||||||
|
|
||||||
log4j.logger.org.apache.directory=INFO
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<configuration>
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="org.apache.directory" level="WARN"/>
|
||||||
|
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
|
@ -10,11 +10,11 @@ dependencies {
|
||||||
"org.springframework:spring-expression:$springVersion",
|
"org.springframework:spring-expression:$springVersion",
|
||||||
"org.springframework:spring-jdbc:$springVersion",
|
"org.springframework:spring-jdbc:$springVersion",
|
||||||
"org.springframework:spring-tx:$springVersion",
|
"org.springframework:spring-tx:$springVersion",
|
||||||
"org.springframework:spring-web:$springVersion",
|
"org.springframework:spring-web:$springVersion"
|
||||||
"org.springframework:spring-test:$springVersion"
|
|
||||||
|
|
||||||
provided 'javax.servlet:servlet-api:2.5'
|
provided 'javax.servlet:servlet-api:2.5'
|
||||||
|
|
||||||
testCompile 'commons-codec:commons-codec:1.3'
|
testCompile 'commons-codec:commons-codec:1.3',
|
||||||
|
"org.springframework:spring-test:$springVersion"
|
||||||
testRuntime "hsqldb:hsqldb:$hsqlVersion"
|
testRuntime "hsqldb:hsqldb:$hsqlVersion"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue