Send files to CloudWatch logs
2.3K
Send files to CloudWatch logs.
Run with the directory of the log file mounted inside the container and
specifying the LOG_GROUP_NAME, LOG_STREAM_NAME and LOG_FILE environment
variables. Also, the usual AWS CLI environment
variables
can also be specified. Lastly, the AWS region is deduced on startup by accessing
the instance
metadata,
unless the AWS_DEFAULT_REGION enviroment variable is specified. By default the
container uses the nobody user, but you may need to specify a different user
in case the log file is not readable but that user. For file rotation
detection,
don't mount just the file but the whole directory inside the container.
docker run -d -v '/var/log:/var/log:ro' -e 'LOG_GROUP_NAME=/var/log/' -e 'LOG_STREAM_NAME={instance_id}' -e 'LOG_FILE=/var/log/ecs/ecs-agent.log.*' adarnimrod/cw-logs
This software is licensed under the MIT license (see LICENSE.txt).
Nimrod Adar, contact me or visit my website. Patches are welcome via git send-email. The repository is located
at: https://www.shore.co.il/git/.
Content type
Image
Digest
Size
37.6 MB
Last updated
about 6 years ago
docker pull endlessm/cw-logs