Closed DavidRobb closed 1 month ago
Error
is appended to System.err
and others are appended to System.out
. It might be reader of those streams that doesn't synchronize them correctly. Could you share the reproducer project so we can try on our systems? Thanks!
OK. Here's an Intellij Idea project folder: KermitTest.zip
I believe the problem is in how Gradle forwards the system streams. If you run ./gradlew createDistributable
and then run the binary from terminal, the order of messages is correct always. I've had trouble with stream outputs in Gradle in the past.
If you add System.setErr(System.out)
to fun main()
(before you call application
), you can see it prints it in the right order each time. Do not do that for a production app, it's just to show that Kermit doesn't control the order, it's whatever is reading from the streams.
OK. Thanks for the explanation. Yes, this works for me.
I an using version 2.0.4 in a desktop build on Windows using the Azul Zulu 21.0.1 SDK and would expect log messages to come out in order regardless of log severity. When running
I see
Sometimes error messages are first, ither times last as shown.