Created
June 21, 2016 21:35
-
-
Save glennpratt/7e760c360c0c7e00b718097d709e2fe0 to your computer and use it in GitHub Desktop.
AWS CodeDeploy logger include.
This file contains hidden or 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
# This sends all output from the command to journalctl while allowing CodeDeploy | |
# agent to capture it as well. It also prefixes the output with timestamps for | |
# better debugging via CodeDeploy logs. | |
# | |
# TODO Consider changing codedeploy-agent to do these things itself. | |
# | |
# NOTE Not POSIX compliant; must run in bash or bash masquerading as sh. | |
# TODO Figure out why codedeploy-agent (using Open3), isn't respecting the | |
# shebang to all our scripts which are /bin/bash. See: | |
# https://github.com/aws/aws-codedeploy-agent/issues/71 | |
set +o posix | |
ISO_8601="%FT%TZ:" | |
exec 1> >(tee >(systemd-cat -t cloud-database-api:$(basename $0)) | ts "$ISO_8601") | |
exec 2> >(tee >(systemd-cat -t cloud-database-api:$(basename $0) -p err) | ts "$ISO_8601" >&2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment