You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2016/09/14 19:21:27 UTC

[2/3] logging-log4j2 git commit: [LOG4J2-1578] RoutingAppender can be configured with scripts.

[LOG4J2-1578] RoutingAppender can be configured with scripts. 

Better test fixture.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c7c72175
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c7c72175
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c7c72175

Branch: refs/heads/master
Commit: c7c721753b95a28a2abe62daec64230bbffdcfe2
Parents: 12336b6
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 14 12:14:13 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 14 12:14:13 2016 -0700

----------------------------------------------------------------------
 .../resources/log4j-routing-default-route-script-groovy.xml   | 5 +----
 .../src/test/resources/log4j-routing-routes-script-groovy.xml | 7 ++-----
 2 files changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c7c72175/log4j-core/src/test/resources/log4j-routing-default-route-script-groovy.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/log4j-routing-default-route-script-groovy.xml b/log4j-core/src/test/resources/log4j-routing-default-route-script-groovy.xml
index cc5eb9b..a5a2561 100644
--- a/log4j-core/src/test/resources/log4j-routing-default-route-script-groovy.xml
+++ b/log4j-core/src/test/resources/log4j-routing-default-route-script-groovy.xml
@@ -20,10 +20,7 @@
   <Appenders>
     <Routing name="Routing">
       <Script name="RoutingInit" language="groovy"><![CDATA[
-        if ("OSNameFoo".contains("Foo")) {
-          return "Service2";
-        }
-        return "Service1";]]>
+        return "OSNameFoo".contains("Foo") ? "Service2": "Service1";]]>
       </Script>
       <Routes>
         <Route key="Service1">

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c7c72175/log4j-core/src/test/resources/log4j-routing-routes-script-groovy.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/log4j-routing-routes-script-groovy.xml b/log4j-core/src/test/resources/log4j-routing-routes-script-groovy.xml
index 83121ea..ddf5a75 100644
--- a/log4j-core/src/test/resources/log4j-routing-routes-script-groovy.xml
+++ b/log4j-core/src/test/resources/log4j-routing-routes-script-groovy.xml
@@ -20,11 +20,8 @@
   <Appenders>
     <Routing name="Routing">
       <Routes>
-        <Script name="RoutingInit" language="groovy"><![CDATA[
-          if ("OSNameFoo".contains("Foo")) {
-            return "Service2";
-          }
-          return "Service1";]]>
+        <Script name="RoutesInit" language="groovy"><![CDATA[
+          return "OSNameFoo".contains("Foo") ? "Service2": "Service1";]]>
         </Script>
         <Route key="Service1">
           <List name="List1" />