From 1f960fa38137e62994de9906f855eae3b64a4db6 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 19 Jul 2015 19:35:37 +0100 Subject: [PATCH] Enable logstash compatible logging for production site --- cookbooks/web/definitions/rails_port.rb | 4 ++++ cookbooks/web/recipes/rails.rb | 1 + 2 files changed, 5 insertions(+) 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"] -- 2.43.2