Eclipse saves console output information as a file

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.