定制神记录?

发布于 2024-10-06 12:26:38 字数 486 浏览 0 评论 0原文

上帝帮助我们在 Rails 盒子上运行一些服务(特别是 Nginx 和 MySQLd),但我希望在它真正投入使用时获得更多细节。到目前为止,使用 w.log = /var/log/god/mysql.log (例如)设置监视日志文件可以让我们得到很多像这样的东西:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 * Starting MySQL database server mysqld
   ...done.

...这足够酷了以它的方式,因为它告诉我服务器宕机了,上帝重新启动了它,但我希望得到诸如时间戳之类的东西,也许还有一些其他细节。 (服务器负载、内存状态或其他可以帮助我诊断 MySQLd 一开始就宕机的原因。)

上帝支持在触发此类事件时向日志文件添加额外的信息吗?

God has helped us keep a few services running on a Rails box (Nginx and MySQLd, specifically) but I'm hoping to get some more details when it actually swings into action. So far, setting the watch log file using w.log = /var/log/god/mysql.log (for example) gets us a lot of stuff like this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 * Starting MySQL database server mysqld
   ...done.

...which is cool enough in its way, because it tells me that the server went down and God restarted it, but I'm hoping for something like a timestamp and maybe some other details. (Server load, memory status, or something else to help me diagnose why MySQLd went down to begin with.)

Does God support adding extra information to logfiles when events like this are triggered?

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

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

发布评论

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

评论(1

枉心 2024-10-13 12:26:38

至少你应该能够通过用类似以下内容启动上帝来获得时间戳:

god -Dc config/sst.god --log-level debug

但据我所知应该已经有是 w.log 文件中日志消息之前的时间戳。就日志文件自定义而言,它看起来像是 问题已经持续了几年(简短的回答:这不是一个选择)。

At the very least you should be able to get a timestamp by starting god with something like:

god -Dc config/sst.god --log-level debug

but as far as I can tell there should already be timestamps preceding log messages in your w.log file. As far as logfile customization goes, it looks like it's been an issue for a few years (short answer: it's not an option).

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