oink icon indicating copy to clipboard operation
oink copied to clipboard

Oink and serving assets

Open nathany opened this issue 12 years ago • 4 comments

Would it be possible to filter out oink logging when Rails is serving assets (in development)?

It currently spams my logs like this (asset logging itself is being silenced, otherwise those requests would show up):

Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
Feb 07 12:36:18 zephyr rails[2941]: Oink Log Entry Complete
Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
Feb 07 12:36:18 zephyr rails[2941]: Oink Log Entry Complete
Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
Feb 07 12:36:18 zephyr rails[2941]: Oink Log Entry Complete
Feb 07 12:36:18 zephyr rails[2941]: Memory usage: 2658288 | PID: 2941
...

nathany avatar Feb 07 '13 19:02 nathany

Since Oink is executed in Rack Middleware, an approach like this might be a good way to go:

http://icelab.com.au/articles/wrapping-rack-middleware-to-exclude-certain-urls-for-rails-streaming-responses/

Happy to accept a patch that works similarly to this for Oink's middleware.

noahd1 avatar Feb 15 '13 07:02 noahd1

Any progress with this?

KieranP avatar Oct 08 '13 21:10 KieranP

Seems like this is basically a development-only kind of issue. Are you making use of Oink in development? If not would just suggest turning oink off entirely in development mode. Otherwise, not sure -- you could wrap the oink middleware in your own to exclude assets.

noahd1 avatar Oct 09 '13 02:10 noahd1

Just fyi, we're no longer using Oink in development.

nathany avatar Oct 09 '13 16:10 nathany