Configure IntelliJ to print the standard output in the console window but also save it to file

Intellij Idea

Intellij Idea Problem Overview


How can I configure IntelliJ to capture the standard output of the application to a file, but still display it in the standard console window?

Intellij Idea Solutions


Solution 1 - Intellij Idea

This feature is available starting from IntelliJ IDEA 11:

save log

Solution 2 - Intellij Idea

This feature does work in IDEA 14.1.1. Also in Run/Debug configuration.

enter image description here

The writing occurs after the run finishes.

Solution 3 - Intellij Idea

In IntelliJ IDEA 2021.2 this no longer works.

P.S. If your motivation is because you can't scroll back to the output start you can increase how many lines you can scroll backwards.

Screenshot of scrollback buffer size setting.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGrzenioView Question on Stackoverflow
Solution 1 - Intellij IdeaCrazyCoderView Answer on Stackoverflow
Solution 2 - Intellij IdeaSophia FengView Answer on Stackoverflow
Solution 3 - Intellij IdeaYitzchok GinzbergView Answer on Stackoverflow