-
-
Save timothyandrew/79de202f486c26eb40e0 to your computer and use it in GitHub Desktop.
Custom Logentries Recipe for SurveyWeb (Engineyard)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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