Exclude hearbeat calls from logger

27 views
Skip to first unread message

abhijit nandy

unread,
Apr 9, 2022, 1:29:03 AM4/9/22
to Roda
I'm using both the heartbeat and the common_logger plugin.

However, my logs are getting filled from the heartbeat calls. How can I tell common_logger to exclude the heartbeat pings?

Jeremy Evans

unread,
Apr 10, 2022, 1:23:25 AM4/10/22
to ruby...@googlegroups.com
On Fri, Apr 8, 2022 at 10:29 PM abhijit nandy <ma...@abhij.it> wrote:
I'm using both the heartbeat and the common_logger plugin.

However, my logs are getting filled from the heartbeat calls. How can I tell common_logger to exclude the heartbeat pings?

This behavior is by design.  Currently, the only way to remove it would be to do something like the following in your Roda app:

  def _roda_after_90__common_logger
    super unless env['PATH_INFO'] == opts[:heartbeat_path]
  end

I suppose I could add a separate plugin building on top of common_logger to avoid logging some requests.

Thanks,
Jeremy
Reply all
Reply to author
Forward
0 new messages