Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

System.out vs System.err questions

407566Jul 15 2008 — edited Jul 15 2008
Hello,

System.out and System.err both seem to direct regular and error output to the stdout. I have the following questions:

1. I used System.setOut() to direct regular output to "Output.txt" and System.setErr() to direct errors to "Errors.txt". I purposely made the program to throw some exceptions, wanting to redirect them to "Errors.txt". It did not work. My question is "What kind of errors setErr() would direct to an error file?"

2. Without using setErr(), errors go to stdout. My question is "Does Java hava a configuration file I can configue to direct regular output to stdout, but errors to a user-defined file such as errors.log?"

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2008
Added on Jul 15 2008
5 comments
242 views