Repository: freemarker
Updated Branches:
  refs/heads/3 d5b83a0c6 -> 302f579cd


Test logs can be directed into a file via system property 
org.apache.freemarker.test.logFile


Project: http://git-wip-us.apache.org/repos/asf/freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/freemarker/commit/302f579c
Tree: http://git-wip-us.apache.org/repos/asf/freemarker/tree/302f579c
Diff: http://git-wip-us.apache.org/repos/asf/freemarker/diff/302f579c

Branch: refs/heads/3
Commit: 302f579cdb886f6ac88da9ea781c5d5029b714cd
Parents: d5b83a0
Author: ddekany <ddek...@apache.org>
Authored: Sun Apr 8 08:59:22 2018 +0200
Committer: ddekany <ddek...@apache.org>
Committed: Sun Apr 8 08:59:22 2018 +0200

----------------------------------------------------------------------
 freemarker-test-utils/build.gradle              |  1 +
 .../src/main/resources/logback-test.xml         | 33 ++++++++++++++------
 2 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/freemarker/blob/302f579c/freemarker-test-utils/build.gradle
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/build.gradle 
b/freemarker-test-utils/build.gradle
index fadde2b..3e3a9d1 100644
--- a/freemarker-test-utils/build.gradle
+++ b/freemarker-test-utils/build.gradle
@@ -35,6 +35,7 @@ dependencies {
 
     // Logging during testing:
     runtime "ch.qos.logback:logback-classic:1.1.8"
+    runtime "org.codehaus.janino:janino:3.0.6"
     runtime "org.slf4j:jcl-over-slf4j:$slf4jVersion"
     runtime "org.apache.logging.log4j:log4j-to-slf4j:2.8.2"
 }

http://git-wip-us.apache.org/repos/asf/freemarker/blob/302f579c/freemarker-test-utils/src/main/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/resources/logback-test.xml 
b/freemarker-test-utils/src/main/resources/logback-test.xml
index 43a37d2..dc96e8d 100644
--- a/freemarker-test-utils/src/main/resources/logback-test.xml
+++ b/freemarker-test-utils/src/main/resources/logback-test.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
@@ -19,17 +18,33 @@
 -->
 <configuration>
 
-       <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-               <encoder>
-                       <pattern>%d{HH:mm:ss.SSS} %-5level [%c] %C{20}:%L - 
%msg%n</pattern>
-               </encoder>
-       </appender>
-       
+       <property name="pattern"
+               value="%d{HH:mm:ss.SSS} %-5level [%c] %C{20}:%L - %msg%n" />
+
+       <if condition='p("org.apache.freemarker.test.logFile").equals("")'>
+               <then>
+            <appender name="APPENDER" 
class="ch.qos.logback.core.ConsoleAppender">
+                <encoder>
+                    <pattern>${pattern}</pattern>
+                </encoder>
+            </appender>
+               </then>
+               <else>
+            <appender name="APPENDER" class="ch.qos.logback.core.FileAppender">
+                <file>${org.apache.freemarker.test.logFile}</file>
+                <encoder>
+                    <pattern>${pattern}</pattern>
+                </encoder>
+            </appender>
+               </else>
+       </if>
+
+
        <logger name="org.eclipse.jetty" level="INFO" />
        <!-- logger name="org.apache.freemarker" level="TRACE" / -->
 
        <root level="debug">
-               <appender-ref ref="STDOUT" />
+               <appender-ref ref="APPENDER" />
        </root>
-       
+
 </configuration>
\ No newline at end of file

Reply via email to