Is it possible to execute custom code when God restarts a process. Please see sample below of what I mean. When watch transitions from :up to :start (process restarted), we want to send a log to syslog at :error level. applog
is a method defined in God module.
w.transition(:up, :start) do |on|
applog(w, :error, "critical server process exited")
on.condition(:process_exits) do |c|
c.notify = 'alerts'
Currently, I see message in syslog when the watch config is loaded. How else can I log an error in syslog on a certain transition?