diff --git a/Changelog.md b/Changelog.md index b4110747b..6cbeeacc0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,7 +12,7 @@ * Do not generate paths like `/a/b/c/config/boot.rb/../../Gemfile` to require and open things, create a proper path instead. * Remove the hack for loading the entire lib folder with a proper solution. [#3809](https://github.com/diaspora/diaspora/issues/3750) * Update and refactor the default public view `public/default.html` [#3811](https://github.com/diaspora/diaspora/issues/3811) - +* Write unicorn stderr and stdout [#3785](https://github.com/diaspora/diaspora/pull/3785) ## Features 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!