Engine Yard

Intro

Engine Yard is a Platform-as-a-Service for deploying and scaling applications on EC2. Here’s how to aggregate system and app logs from Engine Yard Cloud servers, including chef deploy logs, Rails request logs, and Unix syslog.

Setup: chef recipe

Engine Yard Cloud uses chef for most configuration, and makes it easy to create custom chef recipes. A recipe for Papertrail is available from the official ey-cloud-recipes repo.

This cookbook installs and sets up Papertrail’s tiny remote_syslog2 daemon (details), which reads and aggregates syslog and app logs in realtime. It also installs the syslog-ng server, a more feature-rich syslogd than is included in the standard EY Gentoo image.

Using the cookbook

Setup (Alternative): Manual

If you don’t use chef, and just want to test on a single server, or can’t modify your chef recipes, you can setup EY-managed servers manually using Papertrail’s standard instructions.

From Papertrail’s Dashboard, click Add Systems and follow Papertrail’s Linux setup instructions to edit the system syslog configuration. The instructions also cover how to manually install remote_syslog2 for app logs.

Troubleshooting

Can’t deploy syslog-ng on Gentoo Linux using the Engine Yard chef recipe

When you try and run a deployment, you see the following error message:

ERROR: package[app-admin/syslog-ng] (/etc/chef-custom/recipes/cookbooks/papertrail/recipes/default.rb line 44) had an error:
emerge -g --color n --nospinner --quiet =app-admin/syslog-ng-3.3.5 returned 1, expected 0 
---- Begin output of emerge -g --color n --nospinner --quiet =app-admin/syslog-ng-3.3.5

This is caused by a bug in the enable_package resource. emerge_package doesn’t unmask the syslog-ng package, which prevents it from being installed. To fix it, download and apply the updated version of enable_package.rb from the emerge cookbook here.

Replace the emerge/definitions/enable_package.rb in your own cookbook repo with this patched file. If the emerge cookbook is not already included in main/recipes/default.rb, add it. The result will be un-masking syslog-ng so that it can be installed.

Questions

We’re happy to help. Ask a question or join support chat here.