是否可以将控制台输出重定向到Eclipse中的IntelliJ中的日志文件? [英] Is it possible to redirect console output to a log file in IntelliJ like Eclipse?
问题描述
在Eclipse中,可以使用概述的方法将控制台输出重定向到日志文件这里。
In Eclipse it's possible to redirect console output to a log file using the method outlined here.
IntelliJ IDEA中是否有类似的功能?
Is there a similar feature in IntelliJ IDEA?
推荐答案
目前在IDEA中不可能,我已经提交了新功能请求。随意投票。
Not possible in IDEA at the moment, I've submitted a new feature request. Feel free to vote.
可以使用带有main()方法的包装类来实现解决方法,该方法将重定向 stdout 和 stderr 到文件,然后运行应用程序的主类。
A workaround could be implemented using wrapper class with main() method which will redirect stdout and stderr to files and then run the main class of your application.
更新:此功能< a href =https://stackoverflow.com/questions/8121721/configure-intellij-to-print-the-standard-output-in-the-console-window-but-also-s/8122275#8122275>可用在IDEA 11中。
这篇关于是否可以将控制台输出重定向到Eclipse中的IntelliJ中的日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!