Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom God logging?

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?

like image 265
pjmorse Avatar asked Feb 17 '26 09:02

pjmorse


1 Answers

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

like image 62
Andy Mikula Avatar answered Feb 19 '26 02:02

Andy Mikula



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!