This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arrange classpath to use logback in tests
- Loading branch information
Showing
5 changed files
with
54 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"]) |