ridiculous / grape-middleware-logger

Logging middleware for Grape apps
MIT License
53 stars 32 forks source link

logging 404s #20

Closed skandragon closed 5 years ago

skandragon commented 7 years ago

It doesn't appear requests that return 404s are logged. Is there an option I can use to enable these, or is this difficult since there is no catch-all route to hook into?

ridiculous commented 5 years ago

I think this can't currently be done with this middlewar, since grape intercepts farther upstream

ridiculous commented 5 years ago

I've had to do this tho to work with 404s:

class API < Grape::API
  cascade false # Prevents unfound routes from rendering 404 page
  use Grape::Middleware::Logger
end

in case it helps