Skip to content

Instantly share code, notes, and snippets.

@jackyu
Created July 17, 2013 07:27
Show Gist options
  • Save jackyu/6018402 to your computer and use it in GitHub Desktop.
Save jackyu/6018402 to your computer and use it in GitHub Desktop.
[筆記][Rails] 將開發環境中的 asset log 過濾不顯示方式,參考 https://gist.github.com/toolmantim/4957786
# Add the following configuration to your config/environments/development.rb file
#
# This will set the Rails to log to STDOUT (insetad of log/development.log) as well
# as tag all assets request log lines with [assets]
#
# You can then pipe it into grep to filter out the asset lines
#
# tail -f log/development.rb | grep -v '\[assets\]'
#
# If you log to STDOUT rather than log/development.rb then you can:
#
# rails s | grep -v '\[assets\]'
#
# or:
#
# foreman start | grep -v '\[assets\]'
SomeApp::Application.configure do
# Tag assets requests log lines with [assets]
config.log_tags = [
-> request { :assets if request.path.starts_with?(config.assets.prefix) },
-> request { nil }
]
# If you want to log to STDOUT rather than log files
# config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment