开发者

Custom God logging?

开发者 https://www.devze.com 2023-01-29 11:54 出处:网络
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 lo

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?


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号