Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Last active August 29, 2015 14:08
Show Gist options
  • Save shaik2many/978ee69c19e6690e567d to your computer and use it in GitHub Desktop.
Save shaik2many/978ee69c19e6690e567d to your computer and use it in GitHub Desktop.
java sysout file
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