redirect native stderr (not the log file) of gradle daemon to a file

16 Views Asked by At

For a few weeks my builds (even the smallest projects) randomly fail with:

Could not dispatch a message to the daemon.

Gradle daemon writes its logs to ~/.gradle/daemon/$version/, however, in daemon.out.log the last message is:

Executing build with daemon context

I added to my global gradle.properties the line:

org.gradle.jvmargs=-Xrunjdwp:transport=dt_socket,server=y,suspend=n

and unfortunately, the message: Listening for transport dt_socket at address is missing in the log. Still, I was able to attach a debugger and I see that System.err==org.gradle.internal.io.LinePerThreadBufferingOutputStream@3bf76e6d. Maybe this trick works while the VM is still alive, but what happens when it crashes? It seems that a JVM crash output won't be written to that file.

So my question is: how to configure Gradle to redirect the daemon's native stderr to a file so I can troubleshoot further?

0

There are 0 best solutions below