Where can I view Tomcat log files in Eclipse?
在Eclipse中,我可以在哪里查看Tomcat日志文件?
For some reason my Tomcat installation/log folder is always empty.
出于某种原因,我的Tomcat安装/日志文件夹总是空的。
BTW, does Tomcat dump to the log file after a while or is it immediate?
顺便说一下,Tomcat是否在一段时间后转储到日志文件中,或者是直接的?
8 个解决方案
#1
77
Go to the "Server" view, then double-click the Tomcat server you're running. The access log files are stored relative to the path in the "Server path" field, which itself is relative to the workspace path.
转到“Server”视图,然后双击正在运行的Tomcat服务器。访问日志文件相对于“服务器路径”字段中的路径存储,“服务器路径”字段本身相对于工作区路径。
#2
156
I'm not sure if you were after catalina.out or one of the other logs produced by Tomcat.
我不知道你是不是在追卡特琳娜。由Tomcat生成的其他日志。
But, if you're after the catalina.out log file then follow the directions below:
但是,如果你在追加泰罗尼亚的话。退出日志文件,然后按照以下说明:
-
In the servers tab, double-click on the Tomcat Server. You will get a screen called Overview.
在servers选项卡中,双击Tomcat服务器。您将得到一个名为Overview的屏幕。
-
Click on "Open launch configuration". Click on the "Common" tab.
点击“打开启动配置”。单击“公共”选项卡。
-
Towards the bottom of the screen you can check the "File" checkbox and then specify a file that can be used to log your console (catalina.out) output.
在屏幕的底部,您可以选中“File”复选框,然后指定一个文件,用于记录控制台(catalina.out)输出。
-
Finally, restart the Tomcat server.
最后,重新启动Tomcat服务器。
#3
15
Another forum provided this answer:
另一个论坛提供了以下答案:
Ahh, figured this out. The following system properties need to be set, so that the "logging.properties" file can be picked up.
啊,算出来。需要设置以下系统属性,以便“日志记录”。属性文件可以被拾取。
Assuming that the tomcat is located under an Eclipse project, add the following under the "Arguments" tab of its launch configuration:
假设tomcat位于Eclipse项目下,在其启动配置的“Arguments”选项卡下添加以下内容:
-Dcatalina.base="${project_loc}\<apache-tomcat-5.5.23_loc>"
-Dcatalina.home="${project_loc}\<apache-tomcat-5.5.23_loc>"
-Djava.util.logging.config.file="${project_loc}\<apache-tomcat-5.5.23_loc>\conf\logging.properties"
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
http://www.coderanch.com/t/442412/Tomcat/Tweaking-tomcat-logging-properties-file
http://www.coderanch.com/t/442412/Tomcat/Tweaking-tomcat-logging-properties-file
#4
11
Looks like the logs are scattered? I found access logs under <ProjectLocation>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\logs
看起来日志是分散的?我在
#5
3
Double click and open the server. Go to 'Arguments'. -Dcatalina.base= .. something. Go to that something. Your logs are there.
双击并打开服务器。去“参数”。-Dcatalina。基础= . .一些东西。去的事情。你的日志。
#6
2
@royalsampler说:
Go to the Servers view in Eclipse then right click on the server and click Open. The log files are stored in a folder realative to the path in the "Server path" field.
转到Eclipse中的Servers视图,然后在服务器上右键单击并单击Open。日志文件存储在“服务器路径”字段的路径中。
Since the path field is uneditable, you can also "Open Launch Configuration", click Arguments tab, copy the VM argument for catalina.base (within quotes). This is the full path of your WTP webapp directory. Copying the value to the clipboard can save you the laborious task of browsing the file system to the path.
由于path字段是不可编辑的,您还可以“打开启动配置”,单击Arguments选项卡,为catalina复制VM参数。(引号内)。这是WTP webapp目录的完整路径。将值复制到剪贴板可以节省浏览路径文件系统的繁重任务。
Also note you should be seeing the output to the log file in your Console view as you run or debug.
还要注意,在运行或调试时,您应该在控制台视图中看到日志文件的输出。
#7
1
If you want logs in a separate file other than the console: Double click on the server--> Open Launch Configuration--> Arguments --> add -Dlog.dir = "Path where you want to store this file" and restart the server.
如果您想要在控制台以外的单独文件中登录:双击服务器——>打开启动配置——>参数——>添加-Dlog。dir =“要存储此文件的路径”并重新启动服务器。
Tip: Make sure that the server is not running when you are trying to add the argument. You should have log4j or similar logging framework in place.
提示:在尝试添加参数时,请确保服务器没有运行。您应该有log4j或类似的日志框架。
#8
1
if you're after the catalina.out log and you are using eclispe with tomcat, this works for me:
如果你在追加泰罗尼亚的话。退出日志,您正在使用eclispe与tomcat,这对我来说是可行的:
- create catelina.out some where in your computer. In my case, I put it in logs directory of my tomcat install directory e.g: /opt/apache-tomcat-7.0.83/logs/catena.out
- 创建catelina。在你的电脑里。在我的示例中,我将它放在tomcat安装目录e的logs目录中。旅客:/ opt / apache-tomcat-7.0.83 /日志/ catena.out
- go to your eclipse, in the servers tab, double-click on the Tomcat Server. You will get a screen called Overview.
- 转到您的eclipse,在servers选项卡中,双击Tomcat服务器。您将得到一个名为Overview的屏幕。
- Click on "Open launch configuration". Then click on the "Common" tab.
- 点击“打开启动配置”。然后单击“公共”选项卡。
- At standard input and output section, check "output file", click on file system and then selected the folder where your create your catelina.out.
- 在标准输入和输出部分,检查“输出文件”,单击文件系统,然后选择创建catelina.out的文件夹。
- Finally, restart the Tomcat server.
- 最后,重新启动Tomcat服务器。
#1
77
Go to the "Server" view, then double-click the Tomcat server you're running. The access log files are stored relative to the path in the "Server path" field, which itself is relative to the workspace path.
转到“Server”视图,然后双击正在运行的Tomcat服务器。访问日志文件相对于“服务器路径”字段中的路径存储,“服务器路径”字段本身相对于工作区路径。
#2
156
I'm not sure if you were after catalina.out or one of the other logs produced by Tomcat.
我不知道你是不是在追卡特琳娜。由Tomcat生成的其他日志。
But, if you're after the catalina.out log file then follow the directions below:
但是,如果你在追加泰罗尼亚的话。退出日志文件,然后按照以下说明:
-
In the servers tab, double-click on the Tomcat Server. You will get a screen called Overview.
在servers选项卡中,双击Tomcat服务器。您将得到一个名为Overview的屏幕。
-
Click on "Open launch configuration". Click on the "Common" tab.
点击“打开启动配置”。单击“公共”选项卡。
-
Towards the bottom of the screen you can check the "File" checkbox and then specify a file that can be used to log your console (catalina.out) output.
在屏幕的底部,您可以选中“File”复选框,然后指定一个文件,用于记录控制台(catalina.out)输出。
-
Finally, restart the Tomcat server.
最后,重新启动Tomcat服务器。
#3
15
Another forum provided this answer:
另一个论坛提供了以下答案:
Ahh, figured this out. The following system properties need to be set, so that the "logging.properties" file can be picked up.
啊,算出来。需要设置以下系统属性,以便“日志记录”。属性文件可以被拾取。
Assuming that the tomcat is located under an Eclipse project, add the following under the "Arguments" tab of its launch configuration:
假设tomcat位于Eclipse项目下,在其启动配置的“Arguments”选项卡下添加以下内容:
-Dcatalina.base="${project_loc}\<apache-tomcat-5.5.23_loc>"
-Dcatalina.home="${project_loc}\<apache-tomcat-5.5.23_loc>"
-Djava.util.logging.config.file="${project_loc}\<apache-tomcat-5.5.23_loc>\conf\logging.properties"
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
http://www.coderanch.com/t/442412/Tomcat/Tweaking-tomcat-logging-properties-file
http://www.coderanch.com/t/442412/Tomcat/Tweaking-tomcat-logging-properties-file
#4
11
Looks like the logs are scattered? I found access logs under <ProjectLocation>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\logs
看起来日志是分散的?我在
#5
3
Double click and open the server. Go to 'Arguments'. -Dcatalina.base= .. something. Go to that something. Your logs are there.
双击并打开服务器。去“参数”。-Dcatalina。基础= . .一些东西。去的事情。你的日志。
#6
2
@royalsampler说:
Go to the Servers view in Eclipse then right click on the server and click Open. The log files are stored in a folder realative to the path in the "Server path" field.
转到Eclipse中的Servers视图,然后在服务器上右键单击并单击Open。日志文件存储在“服务器路径”字段的路径中。
Since the path field is uneditable, you can also "Open Launch Configuration", click Arguments tab, copy the VM argument for catalina.base (within quotes). This is the full path of your WTP webapp directory. Copying the value to the clipboard can save you the laborious task of browsing the file system to the path.
由于path字段是不可编辑的,您还可以“打开启动配置”,单击Arguments选项卡,为catalina复制VM参数。(引号内)。这是WTP webapp目录的完整路径。将值复制到剪贴板可以节省浏览路径文件系统的繁重任务。
Also note you should be seeing the output to the log file in your Console view as you run or debug.
还要注意,在运行或调试时,您应该在控制台视图中看到日志文件的输出。
#7
1
If you want logs in a separate file other than the console: Double click on the server--> Open Launch Configuration--> Arguments --> add -Dlog.dir = "Path where you want to store this file" and restart the server.
如果您想要在控制台以外的单独文件中登录:双击服务器——>打开启动配置——>参数——>添加-Dlog。dir =“要存储此文件的路径”并重新启动服务器。
Tip: Make sure that the server is not running when you are trying to add the argument. You should have log4j or similar logging framework in place.
提示:在尝试添加参数时,请确保服务器没有运行。您应该有log4j或类似的日志框架。
#8
1
if you're after the catalina.out log and you are using eclispe with tomcat, this works for me:
如果你在追加泰罗尼亚的话。退出日志,您正在使用eclispe与tomcat,这对我来说是可行的:
- create catelina.out some where in your computer. In my case, I put it in logs directory of my tomcat install directory e.g: /opt/apache-tomcat-7.0.83/logs/catena.out
- 创建catelina。在你的电脑里。在我的示例中,我将它放在tomcat安装目录e的logs目录中。旅客:/ opt / apache-tomcat-7.0.83 /日志/ catena.out
- go to your eclipse, in the servers tab, double-click on the Tomcat Server. You will get a screen called Overview.
- 转到您的eclipse,在servers选项卡中,双击Tomcat服务器。您将得到一个名为Overview的屏幕。
- Click on "Open launch configuration". Then click on the "Common" tab.
- 点击“打开启动配置”。然后单击“公共”选项卡。
- At standard input and output section, check "output file", click on file system and then selected the folder where your create your catelina.out.
- 在标准输入和输出部分,检查“输出文件”,单击文件系统,然后选择创建catelina.out的文件夹。
- Finally, restart the Tomcat server.
- 最后,重新启动Tomcat服务器。