log日志打印到文本

String str="hello";
try{
System.out.println(Integer.parseInt(str));

}catch(Exception e){
try{
System.setOut(new PrintStream(new FileOutputStream("d:"+File.separator+"log.txt")));
}catch(Exception e1){

}
System.out.println(e);
}





}

你可能感兴趣的:(log日志打印到文本)