简体   繁体   中英

java logger statement printing out weird numbers and text

Initially we are using jdk 1.8 and now we are using jdk 11 version. did all the changes(upgraded) in the "quarkus-plugin-version" and (upgraded)<apache-poi-5.1.0> in the pom.xml file. from this onwards we are facing the below issue... [39m[38;5;145m2022-08-04 07:20:17,663[39m[38;5;188m [39m[38;5;137mWARN [39m[38;5;188m [[39m[38;5;69m received this kind of weird output after ran our java code. I think instead of space its printing some text like "[39m "

private static final Logger logger = LoggerFactory.getLogger(classname.class);

In the above line we are importing Logger from import org.slf4j.Logger; import org.slf4j.LoggerFactory; package. Note: we are not using any configuration file for the logger in our java code.

You are looking at ANSI escape codes . They are used for colouring output in terminals (or similar).

Most terminals remove ANSI escape codes and display the text coloured instead.

It seems like your SLF4J logger (probably logback) assumes it is logging to a terminal that supports ANSI escape codes and adds them to the output.

You can disable that in the configuration of your logger.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM