Link to home
Start Free TrialLog in
Avatar of coder
coderFlag for Australia

asked on

to enable logs for docker containers

Hi Experts,

         I am using docker containers, in my development environment.  It is Ubuntu on AWS.  I had built docker images and run docker containers.

when I try "docker ps"  it displays all running docker containers.  But not able to see the logs and application is not harvesting data(elastic search) from the application.  I can see only few results there are nearly, 8 to 10 docker containers and I am able to see all the images running.  I am not able the see the logs for all the containers.  secondly, there are less results from the harvesters application.  

How will I enable the logs for the containers?   Please help me.

Kind Regards,

Bharath AK
SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi Experts,

        I am able the see the logs for few containers, but not for all the running containers.  What would be the reason?

Secondly ,  how to create an container and run on an aws ubuntu machine.  I have a dockerfile,, from which I can make a docker image.  From Image how can I create a container and run on this aws ubuntu machine.  Please throw some light over it.

With Many thanks,
Bharath AK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bharath,
For setting up docker image in aws machine you should install docker engine first in ubuntu server, later you can follow  this link for setting the image from docker file.

https://deis.com/blog/2015/creating-sharing-first-docker-image/
Avatar of coder

ASKER

Hi Prabin,

      I had tried this command it changed the command prompt to container, when I try
 docker exec -it 43583542fc10 /bin/bash  it changed from root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/harvest-lms#

to root@43583542fc10:/home/lms#  .   it is like a folder with few files.   When I run docker logs <containername>  i can see the logs for few containers for example docker logs ntdl It display the docker logs on that console or putty terminal.  

where as going inside the with docker exec -it <containerId>  bin/bash it goes to another command prompt.  how can I see the logs?

With Many thanks,
Bharath AK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi Prabhin,

        Thank you so much.  I am able go inside container and ls all folders and see all inside that containers.  I found there are no logs folder or file inside that folder, might be logs might not be generated by that application.  I need one more clarification., What is cloud watch, there are logs inside the cloudwatch in AWS, whatz the difference between the logs generated by application vs logs in the cloud watch.  Please throw some light over it.

With Many Thanks,

Bharath AK
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi Experts

Thank you all

Regards,
Bharath AK