When you run a server inside of IntelliJ you can see the console output in the window at the bottom of the screen.
Is there any way to format the output so that IntelliJ will recognize class names and make them clickable? Then when I see a class name in the server output I could click on it and go straight there.
Thanks :)
In the run/debug configuration that will be used for launching the app, click the Logs tab. The Edit Log Files Aliases table displays the list of log files. Select Save console output to file Specify the path to the file.
Control Shift-A to bring Help Command, type "Restore Layout", and it should restore the console tab. There are also two icons in the Debug window that can do that if you have the Debug Toolbar active.
Create a query console Click a data source and select File | New | Query Console. Right-click a data source and select New | Query Console. Click a data source, press Alt+Insert , and select Query Console. Click a data source, press Ctrl+Shift+F10 , and select New Query Console.
As of IntelliJ 14 and alternative to digging through IntelliJ settings, some trial and error revealed that anything with the pattern
(anyfile.ext:line)
preceded by at least one .
in the console gets turned into a file link if there any file known by that name, e.g. .(Whatever.java:55)
, in the workspace excluding those of libraries.
I am using logback. So at a minimum in my logback.xml to get links to my classes I included in my message pattern
.\(%class{0}.java:%line\)
.\( \)
-> A dot must precede the filename:line pattern and the filename:line pattern enclosed in parentheses. Logback requires literal parentheses to be escaped in this case.%class{0}
-> Just the classname without a package.java
-> So that it matches the complete filename:%line
-> Is the logging line of codeIn actuality, I have other things which always includes at least one .
before the (filename:line)
portion, so it is being picked up by IntelliJ just as well.
<pattern>%highlight(%-5level) %d{yyyy-MM-dd'T'HH:mm:ss.SSS} %yellow([%thread]) %blue(%logger{36}\(%class{0}.java:%line\)) %msg%n</pattern>
There is. Taken from online help http://www.jetbrains.com/idea/webhelp/setting-log-options.html
If you are using third-party logging tools, you might want to make the message's output, that mimics a standard linkage to the source code as for stacktrace line (at .(:)). For that, you should add specific Conversion Pattern to your log.xml configuration file. For example, in a log4j Conversion Pattern this would be
<param name="ConversionPattern" value="%-5p - [%-80m] - at %c.%M(%F:%L)%n"/>
However the produces output is quite ugly with fully qualified names, method names etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With