annotate config/environments/production.rb @ 248:9d6f13168d25

Output log to stdout which will be captured by rack logger.
author edogawaconan <me@myconan.net>
date Thu, 10 Oct 2013 04:27:32 +0000
parents d4cf49db9c49
children d47274afe845
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
1 Zeropaste::Application.configure do
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
2 # Settings specified here will take precedence over those in config/application.rb.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
3
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
4 # Code is not reloaded between requests.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
5 config.cache_classes = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
6
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
7 # Eager load code on boot. This eager loads most of Rails and
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
8 # your application in memory, allowing both thread web servers
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
9 # and those relying on copy on write to perform better.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
10 # Rake tasks automatically ignore this option for performance.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
11 config.eager_load = true
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
12
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
13 # Full error reports are disabled and caching is turned on.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
14 config.consider_all_requests_local = false
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
15 config.action_controller.perform_caching = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
16
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
17 # Enable Rack::Cache to put a simple HTTP cache in front of your application
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
18 # Add `rack-cache` to your Gemfile before enabling this.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
19 # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
20 # config.action_dispatch.rack_cache = true
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
21
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
22 # Disable Rails's static asset server (Apache or nginx will already do this).
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
23 config.serve_static_assets = false
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
24
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
25 # Compress JavaScripts and CSS.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
26 config.assets.js_compressor = :uglifier
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
27 # config.assets.css_compressor = :sass
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
28
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
29 # Do not fallback to assets pipeline if a precompiled asset is missed.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
30 config.assets.compile = false
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
31
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
32 # Generate digests for assets URLs.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
33 config.assets.digest = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
34
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
35 # Version of your assets, change this if you want to expire all your assets.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
36 config.assets.version = '1.0'
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
37
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
38 # Specifies the header that your server uses for sending files.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
39 # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
40 # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
41
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
42 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
43 # config.force_ssl = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
44
248
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
45 # # Default logging formatter to keep PID and timestamp
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
46 config.log_formatter = Logger::Formatter.new
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
47
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
48 # Set to :debug to see everything in the log.
248
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
49 config.log_level = :warn
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
50 config.logger = Logger.new(STDOUT)
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
51
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
52 # Recommended by http://help.papertrailapp.com/kb/configuration/unicorn
9d6f13168d25 Output log to stdout which will be captured by rack logger.
edogawaconan <me@myconan.net>
parents: 202
diff changeset
53 config.logger.level = Logger.const_get('WARN')
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
54
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
55 # Prepend all log lines with the following tags.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
56 # config.log_tags = [ :subdomain, :uuid ]
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
57
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
58 # Use a different logger for distributed setups.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
59 # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
60
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
61 # Use a different cache store in production.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
62 # config.cache_store = :mem_cache_store
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
63
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
64 # Enable serving of images, stylesheets, and JavaScripts from an asset server.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
65 # config.action_controller.asset_host = "http://assets.example.com"
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
66
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
67 # Precompile additional assets.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
68 # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
69 # config.assets.precompile += %w( search.js )
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
70
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
71 # Ignore bad email addresses and do not raise email delivery errors.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
72 # Set this to true and configure the email server for immediate delivery to raise delivery errors.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
73 # config.action_mailer.raise_delivery_errors = false
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
74
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
75 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
76 # the I18n.default_locale when a translation can not be found).
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
77 config.i18n.fallbacks = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
78
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
79 # Send deprecation notices to registered listeners.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
80 config.active_support.deprecation = :notify
198
f513b1ca455a Add the new eager_load config parameter.
Edho Arief <edho@myconan.net>
parents: 195
diff changeset
81
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
82 # Disable automatic flushing of the log to improve performance.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
83 # config.autoflush_log = false
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
84
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
85 # Use default logging formatter so that PID and timestamp are not suppressed.
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
86 config.log_formatter = ::Logger::Formatter.new
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
87 end