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
Served asset log messages are pretty annoying! :) #2639
Comments
|
Bump x9+ (see question @ stackoverflow) |
|
+1 |
|
+1, this log takes up too much space in my terminal (~100 lines per request !) |
|
+1 |
5 similar comments
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
+1. There should be a way to control this or configure asset logger like we do with active_record, action_controller etc. Is it using |
|
I use |
|
+1 |
1 similar comment
|
+1 |
|
That is +12 so far... I unfortunately can't code this myself, so if any one wants to make a patch... :D |
|
+1 |
The first line is logged by Rails, the second one by Sprockets. You can shut up Sprockets logging: Rails.application.assets.logger = Logger.new '/dev/null'Sorry but you couldn't do same for the first line |
|
+1 |
1 similar comment
|
+1 |
|
(specific instructions for suggeston from @guilleiguaran): Just put this in your environment file (eg development.rb) to disable the sprockets log: config.after_initialize do |app|
app.assets.logger = Logger.new('/dev/null')
end |
|
+1 |
1 similar comment
|
+1 |
|
3.1 (only) (3.2 breaks before_dipatch) Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def before_dispatch_with_quiet_assets(env)
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
end
alias_method_chain :before_dispatch, :quiet_assets
end3.2 Rails - Rack root tap approach Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def call_with_quiet_assets(env)
previous_level = Rails.logger.level
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
call_without_quiet_assets(env).tap do
Rails.logger.level = previous_level
end
end
alias_method_chain :call, :quiet_assets
end (So much thanks to for the answer and code 'choonkeat' |
|
+1 |
2 similar comments
|
+1 |
|
+1 |
|
@shadowbq thank you, work very well |
|
+1 |
2 similar comments
|
+1 |
|
+1 |
|
This is hugely annoying to us too. It would be nice to see some movement on this issue. |
|
+1 |
|
Hi @Omnipresent, I've just released this as a gem, so you can add it your |
|
+1 |
|
if Rails.env.development? Inside initializer |
|
+1 |
|
@rafamvc (and others): My sprockets railtie (v3.2.11) checks Setting config.assets.logger to false - not nil - in development.rb got rid of the spam. |
|
|
1 similar comment
|
+1 |
|
still on, bitchez |
|
hate to check production logfile with |
|
So when is this getting fixed in a usable way? |
|
tail -f log/development.log | grep -vE "(^$|asset)" |
|
seriously. rails 4 beta and this still a bug. #fml |
|
I love it when someone else does the work. The 'nbroadbent' gem worked fine for me. rails 3.2.13. |
|
+1 |
2 similar comments
|
|
|
+1 |
|
They certainly are. On 08/24/2013 06:16 AM, Davide Miozzi wrote:
|
|
+1 |
2 similar comments
|
+1 |
|
+1 |
|
+1 |
1 similar comment
|
|
|
|
1 similar comment
|
+1 |
Is there a setup to disable them?
I tried
but no luck.
The text was updated successfully, but these errors were encountered: