I am writing simple Java code to take file which will have 16 records and each record will have 6 fields comma separated.

I am writing code to redirect it to new log file which I am creating but the log files are getting generated empty. Below is my code.

```
try 
{
    String s = "";
    FileReader f  = new FileReader ("C:\\file.txt");
    File log_file = new File ("C:\\file_log.txt");
    BufferedReader sr = new BufferedReader(f);
    while((s = sr.readLine()) != null)
    {    
        PrintStream p = new PrintStream(log_file);
        PrintStream console = System.out;
        System.setOut(p);
    }
}
catch(FileNotFoundException e)
{
    System.out.println("check file is present in location");
}

```