Skip to content

Instantly share code, notes, and snippets.

@timothyandrew
Created July 23, 2013 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timothyandrew/79de202f486c26eb40e0 to your computer and use it in GitHub Desktop.
Save timothyandrew/79de202f486c26eb40e0 to your computer and use it in GitHub Desktop.
Custom Logentries Recipe for SurveyWeb (Engineyard)
#
# Cookbook Name:: le
# Recipe:: configure
#
execute "le register --account-key" do
command "le register --account-key #{node[:le_api_key]}"
action :run
not_if { File.exists?('/etc/le/config') }
end
follow_paths = [
"/var/log/syslog",
"/var/log/auth.log",
"/var/log/daemon.log"
]
(node[:applications] || []).each do |app_name, app_info|
follow_paths << "/var/log/nginx/#{app_name}.access.log"
follow_paths << "/var/log/nginx/#{app_name}.access.ssl.log"
follow_paths << "/var/log/nginx/#{app_name}.error.log"
follow_paths << "/data/#{app_name}/current/log/production.log"
follow_paths << "/data/#{app_name}/current/log/unicorn.log"
end
follow_paths.each do |path|
execute "le follow #{path}" do
command "le follow #{path}"
ignore_failure true
action :run
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment