Easy way how to see REST calls in Foreman


here is a nice trick:

How to log REST client calls

Sometimes it is useful to see content of calls that are being made by Foreman
using rest-client library (compute resources, proxy communication etc). This is
as easy as dropping the following file and restarting Foreman:

$ cat >/usr/share/foreman/config/initializers/00_rest_client.rb <<'EOT'
require 'rest_client'
RestClient.log =
Object.new.tap do |proxy|
def proxy.<<(message)
Rails.logger.info message

Expect many new logs in the production.log.

Added to Troubleshooting - Foreman

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman