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

accommodating default rack-cache settings #52

Closed
jjb opened this issue Nov 1, 2013 · 3 comments · Fixed by #103
Closed

accommodating default rack-cache settings #52

jjb opened this issue Nov 1, 2013 · 3 comments · Fixed by #103

Comments

@jjb
Copy link

jjb commented Nov 1, 2013

I think starting in rails 4, rack-cache can be configured with a simple boolean like so:

config.action_dispatch.rack_cache = true

And rails will use defaults: https://github.com/rails/rails/blob/master/railties/lib/rails/application/default_middleware_stack.rb#L83-L91

lograge doesn't accommodate this scenario, and ends up trying to access []= on true https://github.com/roidrage/lograge/blob/master/lib/lograge.rb#L103

since the default verbosity is false anyway, this scenario can be accommodated by simply doing nothing if app.config.action_dispatch.rack_cache == true

let me know what you think and i can put together a pull request

@roidrage
Copy link
Owner

Interesting, the rack_cache setting would then silence the logs or disable rack-cache altogether?

@jjb
Copy link
Author

jjb commented Mar 11, 2014

Not sure I understand your question. What happens is if one uses config.action_dispatch.rack_cache = true in one's config, then lograge blows up as it tries to treat that boolean as a hash. The solution in my project was to use the full hash in the config

config.action_dispatch.rack_cache =
  { metastore: "rails:/", entitystore: "rails:/", verbose: false }

@roidrage
Copy link
Owner

Ah, now I understand, sorry.

This would happen when someone disable rack_cache then. I can add a workaround for that.

til added a commit to til/lograge that referenced this issue Jan 31, 2015
Before this change, the following config setting which is provided as
example in production.rb of current rails versions:

config.action_dispatch.rack_cache = true

would result in a startup failure.

Fixes roidrage#52
til added a commit to til/lograge that referenced this issue Jan 31, 2015
Before this change, the following config setting which is provided as
example in production.rb of current rails versions:

config.action_dispatch.rack_cache = true

would result in a startup failure.

Fixes roidrage#52
til added a commit to til/lograge that referenced this issue Jan 31, 2015
Before this change, the following config setting which is provided as
example in production.rb of current rails versions:

config.action_dispatch.rack_cache = true

would result in a startup failure.

Fixes roidrage#52
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

Successfully merging a pull request may close this issue.

2 participants