Skip to content

Instantly share code, notes, and snippets.

@thomasmichaelwallace
Created July 26, 2017 16:26
Show Gist options
  • Save thomasmichaelwallace/90109ac7085137d30627a9519537c2b5 to your computer and use it in GitHub Desktop.
Save thomasmichaelwallace/90109ac7085137d30627a9519537c2b5 to your computer and use it in GitHub Desktop.
An ebextension to fix node log streaming after rotation.
files:
"/etc/cron.hourly/cron.logrotate.elasticbeanstalk.nodejs.conf":
mode: "000655"
owner: root
group: root
content: |
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.nodejs.conf
/sbin/service awslogs restart
container_commands:
00_remove_old_conf:
command: "rm -fr /etc/cron.hourly/cron.logrotate.elasticbeanstalk.nodejs.conf.bak"
ignoreErrors: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment