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 31467a6..49d989f 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 d5ea035..4c8d3fb 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"]