本文介绍了IntelliJ可以从log4j输出创建源代码的超链接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IntelliJ控制台中,堆栈跟踪会自动包含带来相关源文件的超链接。链接以格式(Log4jLoggerTest.java:25)显示在每一行的末尾。我可以配置log4j以相似的格式输出文本。

In the IntelliJ console, stack traces automatically contain hyperlinks that bring you to the relevant source files. The links appear at the end of each line in the format (Log4jLoggerTest.java:25). I can configure log4j to output text in a similar format.

log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} (%F:%L) - %m%n

在eclipse中,控制台自动将文本像这样链接。在IntelliJ中,堆栈跟踪是链接,但是我自己的输出以相同的形式保持未链接。有没有办法让IntelliJ做同样的事情?

In eclipse, the console automatically turned text like this into links. In IntelliJ, the stack traces are links but my own output in the same form remains un-linked. Is there any way to get IntelliJ to do the same?

推荐答案

是的,可以尝试这种模式:

Yes you can, try this pattern:


<param name="ConversionPattern" value="%-5p - [%-80m] - at %c.%M(%F:%L)%n"/>

这篇关于IntelliJ可以从log4j输出创建源代码的超链接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 12:43