Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log4j2 on Tomcat on Windows produces warning "unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream"

I have a web app deployed on Tomcat 8. My dev env is Eclipse (Luna) on Windows 7 x64. I just finished integrating log4j2 in my code. When I start up Tomcat, I see the following warning:

WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

I did extensive googling but could not see any question related to my problem. I did see that the class is supposed to add coloring to the log file. I am not interested in this feature.

The log4j config is as follows

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </Console>
  </Appenders>
  <Loggers>
    <Root level="TRACE">
      <AppenderRef ref="Console"/>
    </Root>
  </Loggers>
</Configuration>
like image 540
Sharon Ben Asher Avatar asked Apr 26 '15 08:04

Sharon Ben Asher


1 Answers

Ok, After diggind into the log4j2 code, I found a hidden runtime parameter that needs to be specified:

-Dlog4j.skipJansi=true
like image 164
Sharon Ben Asher Avatar answered Oct 06 '22 00:10

Sharon Ben Asher