diff options
author | Diaspora Europe <info@diasp.eu> | 2013-01-08 14:05:05 +0400 |
---|---|---|
committer | Diaspora Europe <info@diasp.eu> | 2013-01-16 16:11:33 +0400 |
commit | fe2a6b5f8589b1d8db63821af5185eb74252905c (patch) | |
tree | 707999b36f506cf889021b5c0d6fdc748d211559 /config | |
parent | 69f0cba5a62b6572ef1e2968253a79835d3be2cc (diff) |
Write unicorn stderr and stdout log
Diffstat (limited to 'config')
-rw-r--r-- | config/defaults.yml | 2 | ||||
-rw-r--r-- | config/diaspora.yml.example | 4 | ||||
-rw-r--r-- | config/unicorn.rb | 8 |
3 files changed, 14 insertions, 0 deletions
diff --git a/config/defaults.yml b/config/defaults.yml index a46a1a62b..e8fe78800 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -28,6 +28,8 @@ defaults: server: port: 3000 rails_environment: 'development' + stderr_log: + stdout_log: database: 'mysql' unicorn_worker: 2 embed_resque_worker: false diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 4e28d975c..ec54a5070 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -107,6 +107,10 @@ configuration: ## Section ## The environment in which the server should be started by default. #rails_environment: 'production' + + ## Write unicorn stderr and stdout log + #stderr_log: '/usr/local/app/diaspora/log/unicorn-stderr.log' + #stdout_log: '/usr/local/app/diaspora/log/unicorn-stdout.log' ## The database type the server should use by default. ## Valid choices are 'mysql' and 'postgres' diff --git a/config/unicorn.rb b/config/unicorn.rb index 456fecf95..3610271b3 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -20,6 +20,14 @@ timeout 30 #pid '/var/run/diaspora/diaspora.pid' #listen '/var/run/diaspora/diaspora.sock', :backlog => 2048 +if AppConfig.server.stderr_log.present? + stderr_path AppConfig.server.stderr_log +end + +if AppConfig.server.stdout_log.present? + stdout_path AppConfig.server.stdout_log +end + before_fork do |server, worker| # If using preload_app, enable this line ActiveRecord::Base.connection.disconnect! |