ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [27/57] [abbrv] ignite git commit: IGNITE-4847: Upgrade log4j2 to version 2.8.1
Date Wed, 12 Apr 2017 07:33:58 GMT
IGNITE-4847: Upgrade log4j2 to version 2.8.1


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

Branch: refs/heads/ignite-3477-debug
Commit: edfa353eba7c87c802df9e32678cb253549949b3
Parents: b99c198
Author: Michael Griggs <endian675@gmail.com>
Authored: Mon Apr 10 12:39:49 2017 -0700
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon Apr 10 12:39:49 2017 -0700

----------------------------------------------------------------------
 modules/log4j2/pom.xml                          |  4 ++--
 .../ignite/logger/log4j2/Log4J2Logger.java      | 23 +++++++++++++++-----
 2 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/edfa353e/modules/log4j2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j2/pom.xml b/modules/log4j2/pom.xml
index 5b0e989..5c6e7c4 100644
--- a/modules/log4j2/pom.xml
+++ b/modules/log4j2/pom.xml
@@ -52,13 +52,13 @@
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-api</artifactId>
-            <version>2.3</version>
+            <version>2.8.1</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-core</artifactId>
-            <version>2.3</version>
+            <version>2.8.1</version>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/edfa353e/modules/log4j2/src/main/java/org/apache/ignite/logger/log4j2/Log4J2Logger.java
----------------------------------------------------------------------
diff --git a/modules/log4j2/src/main/java/org/apache/ignite/logger/log4j2/Log4J2Logger.java
b/modules/log4j2/src/main/java/org/apache/ignite/logger/log4j2/Log4J2Logger.java
index ffe8e1b..dff3179 100644
--- a/modules/log4j2/src/main/java/org/apache/ignite/logger/log4j2/Log4J2Logger.java
+++ b/modules/log4j2/src/main/java/org/apache/ignite/logger/log4j2/Log4J2Logger.java
@@ -353,18 +353,31 @@ public class Log4J2Logger implements IgniteLogger, LoggerNodeIdAware
{
 
         Configuration cfg = ctx.getConfiguration();
 
-        PatternLayout layout = PatternLayout.createLayout("[%d{ABSOLUTE}][%-5p][%t][%c{1}]
%m%n", null, null,
-            Charset.defaultCharset(), false, false, null, null);
+        PatternLayout.Builder builder = PatternLayout.newBuilder();
+
+        builder
+            .withPattern("%d{ABSOLUTE}][%-5p][%t][%c{1}] %m%n")
+            .withCharset(Charset.defaultCharset())
+            .withAlwaysWriteExceptions(false)
+            .withNoConsoleNoAnsi(false);
+
+        PatternLayout layout = builder.build();
+
+        ConsoleAppender.Builder consoleAppenderBuilder = ConsoleAppender.newBuilder();
+
+        consoleAppenderBuilder
+            .withName(CONSOLE_APPENDER)
+            .withLayout(layout);
+
+        ConsoleAppender consoleApp = consoleAppenderBuilder.build();
 
-        final Appender consoleApp = ConsoleAppender.createAppender(layout, null, null, CONSOLE_APPENDER,
null, null);
         consoleApp.start();
 
         AppenderRef ref = AppenderRef.createAppenderRef(CONSOLE_APPENDER, Level.TRACE, null);
 
         AppenderRef[] refs = {ref};
 
-        LoggerConfig logCfg = LoggerConfig.createLogger("false", Level.INFO, LogManager.ROOT_LOGGER_NAME,
"",
-            refs, null, null, null);
+        LoggerConfig logCfg = LoggerConfig.createLogger(false, Level.INFO, LogManager.ROOT_LOGGER_NAME,
"", refs, null, null, null);
 
         logCfg.addAppender(consoleApp, null, null);
         cfg.addAppender(consoleApp);


Mime
View raw message