Last active
August 29, 2015 14:08
-
-
Save shaik2many/978ee69c19e6690e567d to your computer and use it in GitHub Desktop.
java sysout file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SysOutToFile { | |
| public void test() { | |
| String line = System.getProperty("line.separator"); | |
| PrintStream out = new PrintStream(new FileOutputStream("C:/migration-out.txt")); | |
| PrintStream err = new PrintStream(new FileOutputStream("C:/migration-err.txt")); | |
| System.setOut(out); | |
| System.setErr(err); | |
| out.flush(); | |
| err.flush(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment