You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/07/20 16:55:16 UTC

[13/24] incubator-ignite git commit: # ignite-788: sys:IGNITE_HOME

# ignite-788: sys:IGNITE_HOME


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/708da7cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/708da7cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/708da7cd

Branch: refs/heads/ignite-788-last-review
Commit: 708da7cda307ac5895773342951d1378b66a26a8
Parents: a04605a
Author: ashutak <as...@gridgain.com>
Authored: Thu Jul 16 14:02:47 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Thu Jul 16 14:02:47 2015 +0300

----------------------------------------------------------------------
 config/ignite-log4j2.xml                           |  4 ++--
 .../log4j2/GridLog4j2CorrectFileNameTest.java      | 17 +++++++----------
 2 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/708da7cd/config/ignite-log4j2.xml
----------------------------------------------------------------------
diff --git a/config/ignite-log4j2.xml b/config/ignite-log4j2.xml
index 3f7b3d5..95da8c5 100644
--- a/config/ignite-log4j2.xml
+++ b/config/ignite-log4j2.xml
@@ -30,8 +30,8 @@
         <Routing name="FILE">
             <Routes pattern="$${sys:nodeId}">
                 <Route>
-                    <RollingFile name="Rolling-${sys:nodeId}" fileName="work/log/ignite-${sys:nodeId}.log"
-                                 filePattern="work/log/ignite-${sys:nodeId}-%i-%d{yyyy-MM-dd}.log.gz">
+                    <RollingFile name="Rolling-${sys:nodeId}" fileName="${sys:IGNITE_HOME}/work/log/ignite-${sys:nodeId}.log"
+                                 filePattern="${sys:IGNITE_HOME}/work/log/ignite-${sys:nodeId}-%i-%d{yyyy-MM-dd}.log.gz">
                         <PatternLayout pattern="[%d{ABSOLUTE}][%-5p][%t][%c{1}] %m%n"/>
                         <Policies>
                             <TimeBasedTriggeringPolicy interval="6" modulate="true" />

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/708da7cd/modules/log4j2/src/test/java/org/apache/ignite/logger/log4j2/GridLog4j2CorrectFileNameTest.java
----------------------------------------------------------------------
diff --git a/modules/log4j2/src/test/java/org/apache/ignite/logger/log4j2/GridLog4j2CorrectFileNameTest.java b/modules/log4j2/src/test/java/org/apache/ignite/logger/log4j2/GridLog4j2CorrectFileNameTest.java
index 2d8ee82..38cadfe 100644
--- a/modules/log4j2/src/test/java/org/apache/ignite/logger/log4j2/GridLog4j2CorrectFileNameTest.java
+++ b/modules/log4j2/src/test/java/org/apache/ignite/logger/log4j2/GridLog4j2CorrectFileNameTest.java
@@ -49,22 +49,19 @@ public class GridLog4j2CorrectFileNameTest extends TestCase {
      */
     private void checkOneNode(int id) throws Exception {
         String id8;
-        String logPath;
+        File logFile;
 
         try (Ignite ignite = G.start(getConfiguration("grid" + id))) {
             id8 = U.id8(ignite.cluster().localNode().id());
 
-            logPath = "work/log/ignite-" + id8 + ".log";
+            String logPath = "work/log/ignite-" + id8 + ".log";
 
-            assertEquals(logPath, ignite.log().fileName());
-        }
-
-        File logFile = U.resolveIgnitePath(logPath);
+            logFile = U.resolveIgnitePath(logPath);
+            assertNotNull("Failed to resolve path: " + logPath, logFile);
+            assertTrue("Log file does not exist: " + logFile, logFile.exists());
 
-        assertNotNull("Failed to resolve path: " + logPath, logFile);
-        assertTrue("Log file does not exist: " + logFile, logFile.exists());
-        // We have a row in log with the following content
-        // con >>> Local node [ID=NodeId ]
+            assertEquals(logFile.getAbsolutePath(), ignite.log().fileName());
+        }
         String logContent = U.readFileToString(logFile.getAbsolutePath(), "UTF-8");
 
         assertTrue("Log file does not contain it's node ID: " + logFile,