System.out在servlet中写入的位置? [英] Where System.out writes in a servlet?

查看:141
本文介绍了System.out在servlet中写入的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是很想知道,在servlet中调用System.out.print()会发生什么?

它在哪里写文本?

I am just curious to know, what happens when System.out.print() is called in a servlet?
Where does it write the text?

或者servlet中是否有大量使用System.out的东西?

Or is there any significant use of System.out in a servlet?

推荐答案

这取决于你的servlet容器。

It depends on your servlet container.

对于 Tomcat


在unix上运行Tomcat时,控制台输出通常是
重定向到名为catalina.out的文件。该名称可使用环境变量配置
。 (请参阅启动脚本)。无论写入System.err / out的
将被捕获到该文件中。

When running Tomcat on unixes, the console output is usually redirected to the file named catalina.out. The name is configurable using an environment variable. (See the startup scripts). Whatever is written to System.err/out will be caught into that file.

对于 jetty ,您可以将标准输出重定向到文件:

For jetty, you can redirect standard output to a file :


可以将发送到stderr和stdout的所有输出重定向到可以滚动的
文件[...]

It is possible to redirect all output sent to stderr and stdout to a file that can be rolled over [...]

这篇关于System.out在servlet中写入的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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