Yes, I understand your point Daniel, but there's something more.
Let me further elaborate what I am trying to find out.
Let say I have a module containing around 15 to 20
java classes and I have used log4j for all the logging. No System.out.printlns. In my code, I have caught the Checked Exceptions wherever required and have done error reporting from there using the same logger.
So now, I will expect that everything will go to just one log file (one with log4j FileAppender). But, if a runtime exception occurs, that will go to the default system error. That will not go to the log4j log file, which I am going to keep checking for admin activities.
Now RuntimeExceptions are something that ideally should not arise, but in some worst cases, they may arise, and in in my view, catching RuntimeExceptions in the code is not a good practice generally. So now, I have to redirect the system error to a different file from the command prompt where I am going to run my application, and if a uncaught RuntimeException occurs java will print it's stack trace to the default system error.
Now as part of admin activity, I will need to keep checking both the log4j log file and the error log file to which I am redirecting from the command prompt. And I am trying to find out if there is a work around for this - is it somehow possible to redirect the trace of uncaught RuntimeExceptions in the same file as log4j rather than manually redirecting it to a different file and keep checking two files?
Hope this helps clarify the point.