I'm using a standard Java logger (please see enclosed code). But application suddenly hangs! :-(
In particular - there is a "main" application which starts a copy of itself with different command line parameters. All instances of my Java application writes data to own log file (something like mainXXX.log and executorXXX.log, where XXX is a current timestamp).
I see that all test cases produce mainXXX.log =~ 1.3kb, executorXXX.log =~ 320-390 bytes size log files. And then it hang.
I may think the main application could hang but a child application cannot hang for sure!
Because it is very simple and straight-forward, and also I have noticed that if I comment out some log write calls then application will step a bit more further and hang in the different place than before, which I think means that it hanging exactly because of logging.
For example - I see that a child java.exe process hang after 5 writes to a log file. And that could be any log writes. By commenting log writes at the beginning of application I can see it steps futher.
If I kill the main java.exe process the child process unfreeze and continue working and logging.
Do you have any ideas - why it could hang in such way?
Could it be a blocking I/O calls for a java process?
Any ideas - what to check? How to solve?
Could it be because main application writes some data to STDIN for a child java process and then waiting data from STDOUT?
If standard logger is "bad" can you then recommend some good logger solution for Java?
public class MiscUtils
public static void toLogger(Level pLevel, String pMsg)
if (!Logger.global.isLoggable(pLevel)) return ;
// usage example 1
MiscUtils.toLogger(Level.INFO, "* Open db connection...");
// usage example 2
MiscUtils.toLogger(Level.WARNING, String.format("! Trying to load db driver (%1$s)...", pDrvName));