I am currently using java.util.logger in my application. It sends its output to System.err. I need it to continue to do this, but I also need to send that output to something else.
Is there a way to copy the System.err stream so that it can send to two different sources?
As always when note people referencing
java.util.logger
I feel inclined to at least recommend looking at another logging library, such as logback and slf4j.This blog post describes a method which can easily be adapted to support what you're asking for. In short what you need to do is define a PrintStream which can duplicate its output, assign this using: