Redirecting System.out to java.util.logging

  • Thread starter Brian S. Paskin
  • Start date
B

Brian S. Paskin

Hi, I am using the Java logging and some components that I am using
write to System.out/System.err. Is there any way to redirect them to
the java.util.logging.Logger?

Thanks, brian
 
L

Lothar Kimmeringer

Brian said:
Hi, I am using the Java logging and some components that I am using
write to System.out/System.err. Is there any way to redirect them to
the java.util.logging.Logger?

You can write your own PrintStream and replace the original one
with System.setOut und System.setErr. But be careful, that you
don't log to STDOUT ;-)


Regards, Lothar
--
Lothar Kimmeringer E-Mail: (e-mail address removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
 
B

Brian S. Paskin

Lothar: Thanks for the advice. I extended the PrintStream and it
works great.

-brian
 
B

Brian S. Paskin

Lothar: Thanks for the advice. I extended the PrintStream and it
works great.

-brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top