I have a problem using java logging. I have currently set the handler to FileHandler to redirect all my logs to a log file. And in some cases I have to redirect that particular log to the java console. I couldn't able to do that even if I reset the handler to ConsoleHandler.
How do I manage to use two different handlers alternatively when required? That is sometimes I might require to redirect the log to java console and in some cases to a log file.
If anybody knows the solution please reply me.
I appreciate your time.
I think u have to take a look to the System class in java, it provides a way to ridirect streams from and to standard input(System.in) and standard output(System.out).
I think that will help u..Bye.
Thanks for ur reply.
Still I have problem. Since I have rebinded stderr to logger as
System.setErr( new PrintStream( stderrLOS, true ) );
and i did the same for stdout too.
So all my stdout and stderr msgs will be redirected to log file.
NOw i have to reset it to normal, ie. I have to send those msgs to java console instead of log file. Do u have any idea about it?
Thank u for ur time.
To reset to norma all u have to do is :