Skip to content

Instantly share code, notes, and snippets.

@torifat
Forked from avnersorek/000logdna.config
Created June 16, 2016 07:24
Show Gist options
  • Save torifat/51eeb502a943900ad46dc2c08f91354a to your computer and use it in GitHub Desktop.
Save torifat/51eeb502a943900ad46dc2c08f91354a to your computer and use it in GitHub Desktop.
AWS Elastic Beanstalk configuration script for forwarding logs to LogDNA
# Place this file in the .ebextensions folder of your project
files:
"/home/ec2-user/logdna.sh" :
mode: "000777"
owner: root
group: root
content: |
#!/bin/sh
echo "[logdna]
name=LogDNA packages
baseurl=http://repo.logdna.com/el6/
enabled=1
gpgcheck=0" | tee /etc/yum.repos.d/logdna.repo
yum -y install logdna-agent
logdna-agent -k ### LogDNA-API-KEY ###
# /var/log is monitored/added by default (recursively), optionally specify more folders here
logdna-agent -d /var/log/nodejs/nodejs.log
chkconfig logdna-agent on
service logdna-agent start
commands:
logdna:
command: "/home/ec2-user/logdna.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment