如何查看远程服务器上 ruby​​ CGI 应用程序的错误消息?

发布于 2024-08-15 10:22:54 字数 302 浏览 5 评论 0原文

我编写了一个 Ruby(不是 Rails)应用程序来生成网页。该脚本安装在 Linux Web 服务器上,并由 apache 使用 CGI 调用以响应 HTTP 请求。相当标准的东西。

当我在自己的计算机上运行它时,我会查看 apache 错误日志以查看 ruby​​ 错误消息。

但是,在我使用的主机上我无法访问 apache error_log。因此,当我的脚本遇到问题时,我目前无法看到错误消息。通常只是一个空白页面或 apache 错误页面。

我可以通过 ssh 访问主机。

有没有办法轻松查看错误消息和其他日志输出?

I have written a Ruby (not Rails) app which generates web pages. The script is installed on a linux web server and is called up by apache using CGI in response to HTTP requests. Pretty standard stuff.

When I am running it on my own computer I look at the apache error log to see the ruby error messages.

However, on the host that I use I have no access to the apache error_log. Therefore I am presently unable to see the error messages when my script hits a problem. Usually just a blank page or an apache error page.

I have ssh access to the host.

Is there a way to easily see the error messages and other log output?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把梦留给海 2024-08-22 10:22:54

这里有多种解决方案。

  1. 将日志重定向到系统日志(假设您有权访问它)。了解更多此处

  2. 分析 Rails 应用程序日志(不要与 http 混淆)在 your_app_dir/logs 中

Multiple solutions here.

  1. Redirect logs to syslog (assuming you have access to it). Read more here

  2. Analyze Rails application logs (don't be confused by http logs in Apache) in your_app_dir/logs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文