Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Arrange classpath to use logback in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Dec 12, 2012
1 parent f1b7209 commit db4e326
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 72 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.zanata</groupId>
<artifactId>zanata-parent</artifactId>
<version>8</version>
<version>9-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>

Expand Down
22 changes: 9 additions & 13 deletions zanata-war/pom.xml
Expand Up @@ -953,7 +953,14 @@

<dependencies>

<!-- Zanata-specific dependencies -->
<!-- This needs to appear before log4j and before jboss-embedded-all -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<scope>test</scope>
</dependency>

<!-- Zanata-specific dependencies -->

<dependency>
<groupId>org.zanata</groupId>
Expand Down Expand Up @@ -1343,12 +1350,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
Expand Down Expand Up @@ -1425,11 +1426,6 @@
<artifactId>ejb-api</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
Expand Down Expand Up @@ -1469,7 +1465,7 @@

<!-- Testing dependencies -->

<dependency>
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
<version>${jboss.embedded.version}</version>
Expand Down
24 changes: 0 additions & 24 deletions zanata-war/src/test/resources/log4j.xml

This file was deleted.

34 changes: 0 additions & 34 deletions zanata-war/src/test/resources/logback-test.xml

This file was deleted.

44 changes: 44 additions & 0 deletions zanata-war/src/test/resources/logback.groovy
@@ -0,0 +1,44 @@
import ch.qos.logback.classic.boolex.GEventEvaluator
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.core.ConsoleAppender
import ch.qos.logback.core.filter.EvaluatorFilter

import static ch.qos.logback.classic.Level.*
import static ch.qos.logback.core.spi.FilterReply.*

def patternExpression = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n%rootException"


appender("STDERR", ConsoleAppender) {
filter(EvaluatorFilter) {
evaluator(GEventEvaluator) {
expression = 'e.level.toInt() >= WARN.toInt()'
}
onMatch = NEUTRAL
onMismatch = DENY
}
encoder(PatternLayoutEncoder) {
pattern = patternExpression
}
target = "System.err"
}

appender("STDOUT", ConsoleAppender) {
filter(EvaluatorFilter) {
evaluator(GEventEvaluator) {
expression = 'e.level.toInt() < WARN.toInt()'
}
onMismatch = DENY
onMatch = NEUTRAL
}
encoder(PatternLayoutEncoder) {
pattern = patternExpression
}
target = "System.out"
}

// set to TRACE to see hibernate generated sql
//logger("org.hibernate.SQL", TRACE)
//logger("org.hibernate", INFO)

root(ERROR, ["STDERR","STDOUT"])

0 comments on commit db4e326

Please sign in to comment.