[ 
https://issues.apache.org/jira/browse/LOG4J2-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14512354#comment-14512354
 ] 

Gary Gregory commented on LOG4J2-996:
-------------------------------------

So something hacky like this could work:

{noformat}
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
index a652a1e..d3d1bb2 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
@@ -195,6 +195,7 @@
         }
         final PropertiesUtil propsUtil = PropertiesUtil.getProperties();
         if (!propsUtil.getStringProperty("os.name").startsWith("Windows")
+                || propsUtil.getStringProperty("os.name").startsWith("Windows 
8.1")
                 || propsUtil.getBooleanProperty("log4j.skipJansi")) {
             return printStream;
         }
{noformat}

But we need code that would check, presumably, for Windows >= 8.1. I'm not sure 
what version Java sees for Windows 8.1. So the above is a guess.

> ConsoleAppender fails to load Jansi in Windows 8.1 x64
> ------------------------------------------------------
>
>                 Key: LOG4J2-996
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-996
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.2
>         Environment: Windows 8.1 x64 
>            Reporter: Thiago Kronig
>            Priority: Minor
>              Labels: jansi
>
> ConsoleAppender tries to construct a 
> org.fusesource.jansi.WindowsAnsiOutputStream by calling its constructor via 
> reflection, which throws IOException after a JNI call to 
> GetConsoleScreenBufferInfo, forcing ConsoleAppender to ignore Jansi.
> This happens on Windows 8.1 x64.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to