是否可以像 Eclipse 一样将控制台输出重定向到 IntelliJ 中的日志文件? [英] Is it possible to redirect console output to a log file in IntelliJ like Eclipse?

查看:16
本文介绍了是否可以像 Eclipse 一样将控制台输出重定向到 IntelliJ 中的日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 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?

推荐答案

UPDATE:此功能是 在 IDEA 11 中可用.

目前在 IDEA 中不可能,我已经提交了新功能请求.随意投票.

Not possible in IDEA at the moment, I've submitted a new feature request. Feel free to vote.

可以使用带有 main() 方法的 wrapper class 来实现解决方法,该方法会将 stdoutstderr 重定向到文件,然后运行 ​​main()您的应用程序的类别.

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.

这篇关于是否可以像 Eclipse 一样将控制台输出重定向到 IntelliJ 中的日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆