Skip to content

Faraday logging to file #112

@amorsen

Description

@amorsen

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions