简体   繁体   English

java 记录器语句打印出奇怪的数字和文本

[英]java logger statement printing out weird numbers and text

Initially we are using jdk 1.8 and now we are using jdk 11 version.最初我们使用的是 jdk 1.8,现在我们使用的是 jdk 11 版本。 did all the changes(upgraded) in the "quarkus-plugin-version" and (upgraded)<apache-poi-5.1.0> in the pom.xml file.在 pom.xml 文件中的“quarkus-plugin-version”和(升级)<apache-poi-5.1.0> 中进行了所有更改(升级)。 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.从现在开始,我们将面临以下问题... [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 在运行我们的 java 代码后收到了这种奇怪的 output。 I think instead of space its printing some text like "[39m "我认为不是空格而是打印一些文本,例如“[39m”

private static final Logger logger = LoggerFactory.getLogger(classname.class);私有 static 最终记录器 logger = LoggerFactory.getLogger(classname.class);

In the above line we are importing Logger from import org.slf4j.Logger;在上面的行中,我们从 import org.slf4j.Logger 导入 Logger; import org.slf4j.LoggerFactory;导入 org.slf4j.LoggerFactory; package. package。 Note: we are not using any configuration file for the logger in our java code.注意:我们在 java 代码中没有为记录器使用任何配置文件。

You are looking at ANSI escape codes .您正在查看ANSI 转义码 They are used for colouring output in terminals (or similar).它们用于在终端(或类似设备)中为 output 着色。

Most terminals remove ANSI escape codes and display the text coloured instead.大多数终端删除 ANSI 转义码并改为显示彩色文本。

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.看起来您的 SLF4J 记录器(可能是 logback)假设它正在记录到支持 ANSI 转义码的终端并将它们添加到 output。

You can disable that in the configuration of your logger.您可以在记录器的配置中禁用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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