netbox-client-ruby icon indicating copy to clipboard operation
netbox-client-ruby copied to clipboard

Faraday logging to file

Open amorsen opened this issue 2 months ago • 0 comments

Right now there does not seem to be a way to specify a log file for Faraday. The output simply goes to STDOUT.

      Faraday.new(url: config.netbox.api_base_url, headers: headers, ssl: config.faraday.ssl_options) do |faraday|
        faraday.request request_encoding
        faraday.response config.faraday.logger if config.faraday.logger

It would be handy if the last line was something like

        faraday.response *config.faraday.logger if config.faraday.logger

I believe that would enable:

NetboxClientRuby.configure do |config|
        config.faraday.logger = :logger, Logger.new('faraday.log')

This is entirely untested though...

amorsen avatar Oct 20 '25 13:10 amorsen