custom code on process exits

45 views
Skip to first unread message

sumit

unread,
Dec 3, 2014, 2:17:26 PM12/3/14
to god...@googlegroups.com
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'
      end
    end

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?
Reply all
Reply to author
Forward
0 new messages