diff --git a/systemd_notifier.rb b/systemd_notifier.rb index cc4e9ff..26aedcc 100644 --- a/systemd_notifier.rb +++ b/systemd_notifier.rb @@ -11,8 +11,10 @@ class SystemdNotifier MethodExecutor.record("error", "heartbeat", "NOTIFY_SOCKET is not set or is not a socket, am I a service?") @enable_heartbeat = false else + MethodExecutor.record("debug", "heartbeat", "Found NOTIFY_SOCKET, enabling heartbeat") @enable_heartbeat = true @socket = UNIXSocket.new(@notify_socket) + MethodExecutor.record("debug", "heartbeat", "Heartbeat socket opened") end def enabled? @@ -24,6 +26,7 @@ class SystemdNotifier begin @socket.send(message, 0) + MethodExecutor.record("debug", "heartbeat", "Heartbeat sent: #{message}") rescue => e MethodExecutor.error("heartbeat", "Failed to send heartbeat: #{e}") @enable_heartbeat = false