Looks like there is a limit on the number of lines it shows.
I couldn't find it in the settings.
Is there a way to make IDEA keep everything in the Output window?
Preferences/Settings -> Editor -> General -> Console
, check the box next to Override console cycle buffer size
, set to a larger number than 1024 KB.