Can IntelliJ create hyperlinks to the source code from log4j output?

不想你离开。 提交于 2019-12-05 02:38:32

Yes you can, try this pattern:

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

There is a plugin for IntelliJ IDEA to get clickable links in your console called Awesome Console.

FYI, in loback and Intellij 13 this worked for me:

<pattern>%d{dd-MM-yyyy} %d{HH:mm:ss} %p %m - at %C.%M\(%F:%L\)%n</pattern>

Note: I needed the "at" and I also needed to escape the parentheses. Also capital "C" is the fully qualified classname in logback.

With this config I get output like:

10-06-2014 10:10:58 INFO Bean 'mbeanServer' of type [class com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) - at org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker.postProcessAfterInitialization(AbstractApplicationContext.java:1374)

And the final part in parentheses shows up as a link in Intellij.

I don't think there is a way. But I think I submitted this as a feature request a long time ago. Maybe you should do the same. Jetbrains does listen to its customers. But it can take ages before they implement things like this.

This works for me:

log4j.appender.console.layout.ConversionPattern=[%d{MM-dd HH:mm:ss}]%5p %l %m%n
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!