简体   繁体   English

在Windows中观看tomcat日志文件

[英]Watch tomcat log file in Windows

When I was working on Ubuntu, I used the following command to watch changes on catalina.out : 在Ubuntu上工作时,我使用以下命令来观察catalina.out更改:

tail -f /var/log/tomcat7/catalina.out

But now I changed to Windows, and I can't find how to do it. 但是现在我换成了Windows,却找不到如何做。

Thanks in advance. 提前致谢。

You have several options: 您有几种选择:

  1. Install Cygwin, Mingw64 or GNU Utilities and you will have "tail" command 安装Cygwin,Mingw64或GNU实用程序,您将拥有“ tail”命令
  2. Use PowerShell and something like: Get-Content catalina.out -Wait 使用PowerShell和类似以下Get-Content catalina.out -WaitGet-Content catalina.out -Wait

  3. Use external tool like Notepad++: https://www.raymond.cc/blog/monitor-log-or-text-file-changes-in-real-time-with-notepad/ 使用记事本++之类的外部工具: https : //www.raymond.cc/blog/monitor-log-or-text-file-changes-in-real-time-with-notepad/

You can use Notepad++. 您可以使用记事本++。 You can find the setting in Settings -> Preferences... -> MISC -> File Status Auto-Detection. 您可以在设置->首选项...-> MISC->文件状态自动检测中找到该设置。 Check all three boxes and the files will be updated on change and scrolled to the bottom. 选中所有三个框,文件将在更改时更新并滚动到底部。

在此处输入图片说明

Some of the editors like TextPad shows signal when there is any change in the file you opened through this tool. 当您通过此工具打开的文件有任何更改时,某些编辑器(例如TextPad)会显示信号。 You can open your log using some of those editors and whenever Tomcat update the logs you can fetch the changes. 您可以使用其中一些编辑器打开日志,并且每当Tomcat更新日志时,您都可以获取更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM