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

Payload params class is a ActiveSupport::HashWithIndifferentAccess #242

Open
StoneGod opened this issue Oct 16, 2024 · 2 comments
Open

Payload params class is a ActiveSupport::HashWithIndifferentAccess #242

StoneGod opened this issue Oct 16, 2024 · 2 comments

Comments

@StoneGod
Copy link

Environment

Provide at least:

  • Ruby Version. - 3.3.5
  • Rails Version. - 7.1.4
  • Semantic Logger Version. - 4.16.1
  • Rails Semantic Logger Version. - 4.14.0
  • Other Application/framework names and versions (e.g. Puma, etc.).
From: /usr/local/bundle/gems/rails_semantic_logger-4.14.0/lib/rails_semantic_logger/action_controller/log_subscriber.rb:13 RailsSemanticLogger::ActionController::LogSubscriber#process_action:

     8:         controller_logger(event).debug { "Processing ##{event.payload[:action]}" }
     9:       end
    10:
    11:       def process_action(event)
    12:         controller_logger(event).info do
 => 13:           binding.pry
    14:           payload = event.payload.dup
    15:
    16:           # Unused, but needed for Devise 401 status code monkey patch to still work.
    17:           ::ActionController::Base.log_process_action(payload)
    18:

[1] pry(#<RailsSemanticLogger::ActionController::LogSubscriber>)> event
=> #<ActiveSupport::Notifications::Event:0x00007fffcfc6ea68
[2] pry(#<RailsSemanticLogger::ActionController::LogSubscriber>)> event.payload[:params].class
=> ActiveSupport::HashWithIndifferentAccess

Because of this, kibana cannot parse payload params
I can make an MP with a fix if this is really a bug and not a configuration problem

@Drowze
Copy link

Drowze commented Oct 16, 2024

I can confirm this is also the case on Rails Semantic logger 4.17.0

Because of this, kibana cannot parse payload params

Where do you see an error/problem?
HashWithIndifferentAccess is not a problem for us (though we just output our JSON logs to stdout - which seems to be different from your usecase)

@StoneGod
Copy link
Author

I'm still looking for reasons. But the problem is that Kibana does not parse parameters

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