4

I'm struggling to work out what the Logging tag does in the Dockerrun.aws.json file for a Single Container Docker Configuration. All the official docs say about it is Logging – Maps the log directory inside the container.

This sounds like they essentially create a volume from /var/log on the EC2 instance to a directory in the docker filesystem as specified by Logging. I have the following Dockerrun.aws.json file:

{
    "AWSEBDockerrunVersion": "1",
    ...
    "Logging": "/var/log/supervisor"
}

However, when I go to the AWS Console and request the logs for my instance, none of my custom log files located in /var/log/supervisor are in the log bundles. Can anyone explain to me what the purpose of this Logging tag is and how I may use it (or not) to retrieve my custom logs.

EDIT

Here are the Volume mappings for my container (didn't think to check that):

"Volumes": {
    "/var/cache/nginx": "/var/lib/docker/vfs/dir/ff6ecc190ba3413660a946c557f14a104f26d33ecd13a1a08d079a91d2b5158e",
    "/var/log/supervisor": "/var/log/eb-docker/containers/eb-current-app"
},
"VolumesRW": {
    "/var/cache/nginx": true,
    "/var/log/supervisor": true
}

It turns out that /var/log/supervisor is mapping to /var/log/eb-docker/containers/eb-current-app rather than /var/log as I originally suspected. It'd be nice if this was clearer in the documentation.

But it also turns out that I was running the wrong Docker Image which explains why my log files weren't appearing anywhere! Doh!

Stuart Robertson
  • 773
  • 7
  • 22
  • Two things - 1) Can you verify that your log directory is correctly mapped on the EC2 instance? 2) Can you try downloading bundle logs following the guide here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html "Downloading Bundle Logs from the Elastic Beanstalk Console". Basically you request "Full logs" instead of "Last 100 lines". – Rohit Banga Sep 09 '15 at 23:24
  • @RohitBanga I edited my question. Didn't think to check my mappings which helped me debug the issue. If you want to answer with an explanation on how to check mappings or anything you think might help others vaguely relating to this then I'll mark it as accepted. – Stuart Robertson Sep 10 '15 at 09:27
  • Have you find any solution? I had the same problem with logs from `supervisord` – hsrv Dec 18 '15 at 12:54
  • @hsrv my problem is answered in my edit. Whatever path you have in Logging will be mapped to the /var/log/eb-docker/containers/eb-current-app directory when you download the logs from Amazon. If that doesn't fix it for you, ask your own question and hopefully someone can help. If you do ask, post the link here and I'll try answer it myself. – Stuart Robertson Dec 18 '15 at 16:44
  • @StuartRobertson: I have the same issue and couldn't find a solution. I asked a question here: https://stackoverflow.com/questions/42418225/aws-elastic-beanstalk-with-single-container-docker-logging-parameter-in-dockerf – Vincent de Lagabbe Feb 23 '17 at 14:16

0 Answers0