Java 没有catalina.out

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3491574/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:16:09  来源:igfitidea点击:

There is no catalina.out

javatomcatloggingcatalina.out

提问by Tima

I have no idea, how and what to set up, to have catalina.out on the Tomcat on my computer.

我不知道如何设置以及设置什么,以便在我的计算机上的 Tomcat 上安装 catalina.out。

I use Tomcat 6.0.28, zipped-version on Windows XP. To start server I just run startup.bat-file.

我在 Windows XP 上使用 Tomcat 6.0.28,压缩版本。要启动服务器,我只需运行 startup.bat 文件。

Do I do something wrong?!

我做错了什么吗?!

Thanks in advance for any advices.

提前感谢您的任何建议。

Mur

穆尔

[Edited] All records (Exceptions or System.out) will be written in console window. Where to set up, that they would be written to catalina.out?

[已编辑] 所有记录(异常或 System.out)都将写入控制台窗口。在哪里设置,它们会被写入catalina.out?

As I wrote in one of my comments, if I install Tomcat with setup-version, all messages occur in stdout_YYYYMMDD.log and I don't see, where to change this.

正如我在我的一条评论中所写的那样,如果我使用 setup-version 安装 Tomcat,所有消息都会出现在 stdout_YYYYMMDD.log 中,但我看不到在哪里更改它。

回答by Dean

Are you running any applications with the application server as I think it only creates the file when there is an error in an application.

您是否正在使用应用程序服务器运行任何应用程序,因为我认为它只会在应用程序出现错误时创建文件。

回答by newtoallthis

Looks like Tomcat 6 on Windows does not write to catalina.out

看起来 Windows 上的 Tomcat 6 不会写入 catalina.out

I can see why this is happening, but not sure where to fix it.

我可以理解为什么会发生这种情况,但不确定在哪里修复它。

catalina.sh has this line which sends the System outs into catalina.out

catalina.sh 有这条线将系统输出发送到 catalina.out

"$CATALINA_BASE"/logs/catalina.out 2>&1

this line is missing from catalina.bat which is why this does not appear on windows.

catalina.bat 中缺少这一行,这就是为什么这不会出现在 Windows 上的原因。

回答by Mark

I have written a batch file 'start&log.bat' and put it in tomcat\bin directory. The batch file has one line:

我写了一个批处理文件'start&log.bat'并将它放在tomcat\bin目录中。批处理文件有一行:

catalina run > ..\logs\catalina.out 2<&1

回答by jal

my experience is that these logs are always produced somewhere, even if not in catalina.out. on Linux 7 tomcat7 yum installed, my system.out.println( messages end up in /var/log/message. fine with me, as long as I can find them. found them there with grep -r 'system.out.println(' * from root directory. Command takes a long time to run.

我的经验是这些日志总是在某处生成,即使不在 catalina.out 中。在安装了 yum 的 Linux 7 tomcat7 上,我的 system.out.println( 消息最终在 /var/log/message 中。对我很好,只要我能找到它们。用 grep -r 'system.out.println 找到它们(' * 来自根目录。命令需要很长时间才能运行。