summaryrefslogtreecommitdiff
path: root/config/environments/production.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-09-24 10:31:04 +0200
committerAzul <azul@leap.se>2013-09-24 10:35:02 +0200
commit9fa07d19ab9ad8dea15b1fcb8b2c739d79a36d8f (patch)
tree71a70d9b7cb68f639bb1ef5c18d5b35c14a9dd95 /config/environments/production.rb
parent19222102cecca04269de379708bbf71e7f32df24 (diff)
fix syslogger, log_tags are called on request
log_tags was causing errors that could not be logged or caught. We don't need them yet anyway. config.log_tags accepts a list of methods that respond to request object. This makes it easy to tag log lines with debug information like subdomain and request id — both very helpful in debugging multi-user production applications. http://guides.rubyonrails.org/configuring.html
Diffstat (limited to 'config/environments/production.rb')
-rw-r--r--config/environments/production.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 32b4558..7acca75 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -33,11 +33,11 @@ LeapWeb::Application.configure do
# See everything in the log (default is :info)
# config.log_level = :debug
- # Prepend all log lines with the following tags
- # config.log_tags = [ :subdomain, :uuid ]
-
- # Use a different logger for distributed setups
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+ # Use syslog if no file has been specified
+ if APP_CONFIG[:logfile].blank?
+ require 'syslog/logger'
+ config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('webapp'))
+ end
# Use a different cache store in production
# config.cache_store = :mem_cache_store