How can I grep Intellij's build time notifications - which log file has these?

Viewed 85

Can anyone help me figure out how to obtain a list of logged build times from Intellij? A search on the web and in S.O. didn't enlighten.

My intellij IDEa reports java project build times in the Event Log window like so:

Build completed successfully with 1,750 warnings in 5 min, 20 sec

I wanted to grep these notifications to see how my build times have evolved recently (e.g. to see an improvement after excluding certain folders from the antivirus realtime scans).

I found these logfiles under JetBrains folders:

$ find /c/Users/myuser/AppData/*/JetBrains -type f -name \*log
/c/Users/myuser/AppData/Local/JetBrains/IntelliJIdea2021.2/database-log/database.0.log
/c/Users/myuser/AppData/Local/JetBrains/IntelliJIdea2021.2/log/build-log/build.log
/c/Users/myuser/AppData/Local/JetBrains/IntelliJIdea2021.2/log/idea.log
/c/Users/myuser/AppData/Local/JetBrains/Toolbox/logs/toolbox.log
/c/Users/myuser/AppData/Local/JetBrains/Toolbox/statistics/events.log

But none of them contains the build time notifications.

Any tips appreciated, thanks in advance.

2 Answers

The same duration is printed in idea.log file as the following pattern:

2021-09-14 15:30:34,030 [105340589]   INFO - lij.compiler.impl.CompilerUtil -   COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 4299 ms: 0 min 4sec 

This works for gradle because it logs length of the build in console BUILD SUCCESSFUL in 1m 23s, not sure about other build tools. But yes, there is a way to get all information from console during your build to be written to a file, you have to enable it for your run configurations.

Go to Run/Debug Configurations > Modify options > tick Save console output to file, after that the field is going to appear that lets you specify the file path under Save console output to file like on the screen shot.

enter image description here

Related