]> git.openstreetmap.org Git - chef.git/commitdiff
Enable logstash compatible logging for production site
authorTom Hughes <tom@compton.nu>
Sun, 19 Jul 2015 18:35:37 +0000 (19:35 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 19 Jul 2015 18:35:37 +0000 (19:35 +0100)
cookbooks/web/definitions/rails_port.rb
cookbooks/web/recipes/rails.rb

index 31467a6ed3a928a18693ca3ad3a9b1da1c786423..49d989ff3b90669e495c3983b4789b423b993202 100644 (file)
@@ -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
index d5ea0353d2be24aaec0b634803568db4be313a96..4c8d3fb558683fd9820672b4620195dff11f8ddc 100644 (file)
@@ -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"]