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

Remove log message #116

Closed
wee007 opened this issue May 31, 2020 · 4 comments
Closed

Remove log message #116

wee007 opened this issue May 31, 2020 · 4 comments

Comments

@wee007
Copy link

wee007 commented May 31, 2020

Is there a way to remove this log message apart from a monkey patch?

INFO -- : Completed JSON API rendering

I've tried unsubscribing the subscriber and detaching the namespace but to no avail.

@raldred
Copy link

raldred commented Jun 2, 2020

Agreed, they're really noisy and should be moved to debug

@raldred
Copy link

raldred commented Jun 2, 2020

@wee007 Only way I could find to do this was to unsubscribe the instrumentation in an initializer

# config/initializers/jsonapi-rails.rb
ActiveSupport::Notifications.unsubscribe('parse.jsonapi-rails')
ActiveSupport::Notifications.unsubscribe('render.jsonapi-rails')

@wee007
Copy link
Author

wee007 commented Jun 3, 2020

Thanks heaps @raldred ! That worked.

@wee007 wee007 closed this as completed Jun 3, 2020
@ndbroadbent
Copy link

I just ran into this issue. I fixed it by adding this to spec/rails_helper.rb:

ActiveSupport.on_load(:action_controller) do
  ActiveSupport::Notifications.unsubscribe('parse.jsonapi-rails')
  ActiveSupport::Notifications.unsubscribe('render.jsonapi-rails')
end

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

3 participants