5

I'm running my Play! webapp with Docker Cloud (could also use Rancher) and AWS and I'd like to store all the logs in S3 (via volume). Any ideas on how I could achieve that with minimal effort?

radek1st
  • 1,617
  • 17
  • 19

1 Answers1

2

Use docker volumes to store the logs in the host system.

Try S3 aws-cli to sync your local directory with S3 Bucket

aws s3 sync /var/logs/container-logs s3://bucket/ 

create a cron to run it on every minute or so.

Reference: s3 aws-cli

Gangaraju
  • 4,406
  • 9
  • 45
  • 77
  • Thanks, but can you think of a way without tinkering with the host system? It's not straight forward with the default ami provided by Docker Cloud. Any experience with https://hub.docker.com/r/dockercloud/dockup ? – radek1st May 07 '16 at 11:55
  • 1
    not sure why you downvoted - this seems like the simplest solution IMO - just use a docker based version of aws-cli like: https://github.com/xueshanf/docker-awscli and write a bash script to backup the volume mount to s3 every x seconds, then sleep x seconds, rinse repeat... also - not sure what your container is running, but you should have logging solutions available to write to s3 - here's one for nodejs apps - https://github.com/coggle/s3-streamlogger – Chief May 20 '16 at 15:00
  • I didn't downvote. I would hope there is some other solution less hacky though – radek1st Jun 19 '17 at 13:29