Docker Container (C50) - Container command for Log Files
search cancel

Docker Container (C50) - Container command for Log Files

book

Article ID: 246033

calendar_today

Updated On:

Products

AppNeta

Issue/Introduction

While troubleshooting issues with an AppNeta Container Monitoring Point (CMP), you may need to acquire log files to investigate the issue.  Use the following commands to review the log files details.

Resolution

1.  You can acquire log files from the container itself.  Issue docker ps -a to view the running containers

ubuntu@ip-10-0-0-14:~$ sudo docker ps -a
CONTAINER ID        IMAGE                                     COMMAND                  CREATED             STATUS                    PORTS                                                                                                                                                                                                  NAMES
12e45c7cffcb        appneta.azurecr.io/pathview-cmp:current   "/sbin/entrypoing.sh..."   20 hours ago        Up 15 minutes (healthy)
8bff2d64d068   appneta.azurecr.io/talos-engine:current   "/app/run-engine-wra…"   20 hours ago          Up 15 minutes (healthy)  


2. You should see two AppNeta containers, 'pathview-cmp' and 'talos-engine'.    You'll want to use the container ID for the 'pathview-cmp' so in the system example above, that is 12e45c7cffcb

 

3.  The following docker exec is issued.  The exec command allows us to run a command inside the container, which will get us to a bash prompt to run commands from the container itself.  Do note that some of the commands of your linux distribution may not be available in the container.

$ sudo docker exec -it <container id> /bin/bash
root@support-lab-cmp-01:/# cd var/log/pathview
root@support-lab-cmp-01:/var/log/pathview# less Sequencer.log

 

4. Logs can be queried by the standard APM or Docker channels, and they can also be fetched via the in-container logs.sh script that dumps a log tarball to stdout:

docker exec <pathview-cmp> /sbin/logs.sh > /tmp/logs.tar.gz
tar tzvf logs.tar.gz
drwxr-xr-x root/root         0 2019-12-12 13:23 debugOutput/
drwxr-xr-x root/root         0 2019-12-12 13:23 debugOutput/mnt/
drwxr-xr-x root/root         0 2019-12-12 13:23 debugOutput/mnt/data/
-rw-r--r-- root/root        36 2019-12-12 13:23 debugOutput/mnt/data/guid.txt