Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method keys' + undefined method clear_tags!' #48

Open
delphaber opened this issue Mar 15, 2018 · 1 comment
Open

undefined method keys' + undefined method clear_tags!' #48

delphaber opened this issue Mar 15, 2018 · 1 comment

Comments

@delphaber
Copy link

delphaber commented Mar 15, 2018

Hi,

I'm using grape inside Rails. When using Rails.logger as logger and GrapeLogging::Formatters::Default as formatter, I receive these exceptions ( complete backtrace ) when grape tries to log the request.

This is my configuration:

module Foobar
  class Api < Grape::API
    logger Rails.logger

    use GrapeLogging::Middleware::RequestLogger,
      logger: logger,
      formatter: GrapeLogging::Formatters::Default.new,
      include: [ GrapeLogging::Loggers::Response.new,
                 GrapeLogging::Loggers::FilterParameters.new,
                 GrapeLogging::Loggers::ClientEnv.new,
                 GrapeLogging::Loggers::RequestHeaders.new ]

I noticed that if I change logger Rails.logger with logger Rails.logger.dup it works, without any exception. Why?

@delphaber delphaber changed the title undefined method `clear_tags!' undefined method keys' for nil:NilClass + undefined method clear_tags!' Mar 15, 2018
@delphaber delphaber changed the title undefined method keys' for nil:NilClass + undefined method clear_tags!' undefined method keys' + undefined method clear_tags!' Mar 15, 2018
@swistaczek
Copy link

Hey @delphaber, did you find out any solution for this problem :)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants