From: Tom Hughes Date: Sun, 19 Jul 2015 18:35:37 +0000 (+0100) Subject: Enable logstash compatible logging for production site X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/1f960fa38137e62994de9906f855eae3b64a4db6?hp=1f0a00ac5c14d34461d3c1952552b5bd5b083eb7 Enable logstash compatible logging for production site --- diff --git a/cookbooks/web/definitions/rails_port.rb b/cookbooks/web/definitions/rails_port.rb index 31467a6ed..49d989ff3 100644 --- a/cookbooks/web/definitions/rails_port.rb +++ b/cookbooks/web/definitions/rails_port.rb @@ -184,6 +184,10 @@ define :rails_port, :action => [:create, :enable] do line.gsub!(/^( *)#log_path:.*$/, "\\1log_path: \"#{params[:log_path]}\"") end + if params[:logstash_path] + line.gsub!(/^( *)#logstash_path:.*$/, "\\1logstash_path: \"#{params[:logstash_path]}\"") + end + if params[:memcache_servers] line.gsub!(/^( *)#memcache_servers:.*$/, "\\1memcache_servers: [ \"#{params[:memcache_servers].join("\", \"")}\" ]") end diff --git a/cookbooks/web/recipes/rails.rb b/cookbooks/web/recipes/rails.rb index d5ea0353d..4c8d3fb55 100644 --- a/cookbooks/web/recipes/rails.rb +++ b/cookbooks/web/recipes/rails.rb @@ -60,6 +60,7 @@ rails_port "www.openstreetmap.org" do gpx_dir "/store/rails/gpx" attachments_dir "/store/rails/attachments" log_path "#{node[:web][:log_directory]}/rails.log" + logstash_path "#{node[:web][:log_directory]}/rails-logstash.log" memcache_servers %w(rails1 rails2 rails3) potlatch2_key web_passwords["potlatch2_key"] id_key web_passwords["id_key"]