When you running/debugging an application in Eclipse, the running debug information and log information about the application are output to the console display, but eclipse displays only the last part of the log information. If your application generates a lot of running debugging information and log information, you may want to keep this information in the file so that you can view the analysis.
We have 2 ways to generate a file
1. Set Eclipse Save console file. Open the Run Configurations->common menu. Set "Standard Input and output", tick "file:", fill in the output file path and file name. If you tick "Append", the output log will be appended to the end of the file, otherwise overwrite the rewritten file
2. The 2nd method is to control the log information in the program output to a file, if you use Java, you can write in the program
(You can introduce open source packages like log4j in your program to control the output of the log).
System.setout (New PrintStream (New FileOutputStream ("output.txt"));
System.out.println ("This is Test output");
All console outputs will be written to the Output.txt file.
Eclipse saves console output information as a file