Comments (12)
When "Started POST" is logged, we still haven't passed through the method override middleware. I think the sanest fix is to include _method in the Parameters. That is handled here:
https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/log_subscriber.rb#L5
What do you think?
from rails.
Sounds good to me. I'll cook up a patch.
from rails.
We need to fix the "Started POST" part. Whatever is outputting that needs to look at _method. This used to work, so let's not go backwards.
from rails.
Alright, so this is a regression.
I think we should indicate somewhere in the logs both the original method and the overridden method.
josevalim's suggestion does this the easy way by showing the original method in the "Started ..." part and the overridden method in the params.
If you think that that's backwards, we can do something like "Started PUT (overrides POST)". What do you think?
from rails.
When will the "(overrides POST)" be a valuable piece of information? By the time Rails sees the request, Rails won't be able to tell whether it's a real PUT or an artificial PUT.
from rails.
I'd argue that showing the overrides would be useful in various debugging and analytic situations. Also, it could be useful in distinguishing whether or not the request was made by a browser. Rails certainly has the internal ability to differentiate between real and artificial put requests, and applications built on Rails should have the ability as well if they can access the rack env.
from rails.
I don't think it's a valuable enough piece of information to log with every request in the log. If you need it, you can always get at it directly via code. Or if you need it temporarily for debugging, you can do logger.info and output it yourself.
But let's definitely fix the core issue as described at the top of this ticket.
from rails.
Sounds like a plan.
from rails.
@dlee so it is just a matter of removing the started part from here:
https://github.com/rails/rails/blob/master/railties/lib/rails/rack/logger.rb#L24
To here:
https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/log_subscriber.rb#L7
The parameters available in the latter is defined here:
from rails.
I actually went with a different approach since I assumed there was a reason the "Started ..." log was separated into railties/lib/rails/rack/logger.rb in the first place. Expect a pull request soon...
from rails.
Ok, but if the another approach is including a new middleware, I would say it is a no-go. :) Our middleware stack is already too long, which leads to a long call stack that Ruby 1.8.x doesn't like at all. Maybe we could log at the router level? Thanks for your time in this.
from rails.
Closing this one in favor of #430.
from rails.
Related Issues (20)
- Circular data structures raise SystemStackError when serializing them with `#to_json`.
- Mysql2 adapter raises when querying indexes that do not exist HOT 2
- ActiveStorage race condition on attach
- Fix supporting encrypted configuration with integer keys HOT 2
- trilogy: will trilogy support prepared statement HOT 1
- `ActiveRecord::Persistence#becomes` does not clone eager-loading state and can raise Strict Loading violations HOT 2
- normalizes doesn't work with store / store_attributes HOT 1
- Doc Request: ActiveRecord FAQ HOT 3
- Upgrade `marcel` gem to 1.0.3 triggers `ActiveStorage::BlobTest#test_create_and_upload_extracts_content_type_from_filename` failure HOT 3
- where.first_or_create! fails with encrypted attribute fails
- ActionView::Helpers::DateHelper #distance_of_time_in_words Leap Day bug HOT 1
- It is not possible to handle "not a valid MIME type" error using the exceptions_app = self.routes when the value of CONTENT_TYPE header is invalid HOT 4
- #update on CPK association requires an explicit reload to work correctly HOT 4
- Postgres JSONB column default and virtual column expressions are not typecasted on save HOT 1
- Avoidable resource consumption when using "in_batches(use_ranges: true)"
- how to write ruby on rails active records query on ubuntu
- Unintended Fallback to `Rails::HTML4::Sanitizer` for `ActionView::Helpers::SanitizeHelper.sanitizer_vendor` without `sprockets-rails` HOT 4
- Unexpected behaviour for CTE joins when CTE has same name as a relation
- QueryAttributes treated as strings in exec_query HOT 5
- Configuration of config.i18n.fallbacks is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails.