import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
public class SystemExample {
public static void main(String[] args) throws IOException {
PrintStream p = new PrintStream(new FileOutputStream(new File("c:\\temp\\out.log")));
System.setErr(p);
System.out.println("Hello World");
}
}
Redirect standard error stream (System.err) to a file
* * * * * 1 votes
Tags: java.lang




















