How to view logs?
This guide will help you view logs for your playbooks setup to debug any issues or share them with the original authors.
Doctor Droid Playbooks deployment is split between several containers. For any debugging, you can look up logs in the centralised fluentd container. Here are some details:
Docker-Compose
Get the name / id of the fluentd container by running the following:
docker ps | grep fluentd
When you get the name, run the following:
docker logs <container_name> -f
This should help you tail the logs. Each log has the timestamp and the source container name as prefix and the json logs object following then.
Here is a snippet of logs:
2024-09-04 12:19:18 2024-09-04 06:49:18.000000000 +0000 server: {"container_id":"8d0b49c601a601c16e1d5664a7385bb9771fd11c7ec0b6046e884809a59d8127","container_name":"/playbooks-server-1","source":"stderr","log":"2024-09-04 06:49:18,197 - django.request - WARNING - log_response - Unauthorized: /accounts/user/"}
2024-09-04 12:19:18 2024-09-04 06:49:18.000000000 +0000 server: {"log":"172.18.0.12 - - [04/Sep/2024:06:49:18 +0000] \"POST /accounts/user/ HTTP/1.0\" 401 183 \"http://localhost/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\"","container_id":"8d0b49c601a601c16e1d5664a7385bb9771fd11c7ec0b6046e884809a59d8127","container_name":"/playbooks-server-1","source":"stdout"}
2024-09-04 12:19:18 2024-09-04 06:49:18.000000000 +0000 server: {"container_id":"8d0b49c601a601c16e1d5664a7385bb9771fd11c7ec0b6046e884809a59d8127","container_name":"/playbooks-server-1","source":"stdout","log":"172.18.0.12 - - [04/Sep/2024:06:49:18 +0000] \"POST /accounts/user/ HTTP/1.0\" 401 183 \"http://localhost/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\""}
2024-09-04 12:19:18 2024-09-04 06:49:18.000000000 +0000 server: {"source":"stdout","log":"172.18.0.12 - - [04/Sep/2024:06:49:18 +0000] \"GET /accounts/get/login/providers/ HTTP/1.0\" 200 31 \"http://localhost/signup\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\"","container_id":"8d0b49c601a601c16e1d5664a7385bb9771fd11c7ec0b6046e884809a59d8127","container_name":"/playbooks-server-1"}
2024-09-04 12:19:18 2024-09-04 06:49:18.000000000 +0000 server: {"container_id":"8d0b49c601a601c16e1d5664a7385bb9771fd11c7ec0b6046e884809a59d8127","container_name":"/playbooks-server-1","source":"stdout","log":"172.18.0.12 - - [04/Sep/2024:06:49:18 +0000] \"GET /accounts/get/login/providers/ HTTP/1.0\" 200 31 \"http://localhost/signup\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\""}
2024-09-04 12:19:25 2024-09-04 06:49:25.000000000 +0000 celery_beat: {"container_id":"f5cc7392edd76fa9fb74bdd7770c8293052deebe0c540a5b7efe49319ead84f0","container_name":"/playbooks-celery_beat-1","source":"stderr","log":"[2024-09-04 06:49:25,983: INFO/MainProcess] Scheduler: Sending due task workflow-scheduler-job-every-10-seconds (executor.workflows.tasks.workflow_scheduler)"}
2024-09-04 12:19:25 2024-09-04 06:49:25.000000000 +0000 workflow_scheduler_celery_worker: {"log":"[2024-09-04 06:49:25,993: INFO/MainProcess] Task executor.workflows.tasks.workflow_scheduler[7f5315fa-9100-47b6-819d-366b89d1d3d0] received","container_id":"2fcf24a056d26fe7f5702f9ec41cd1464ea5945a32d0adfbeb30f96acc3e33b3","container_name":"/playbooks-workflow_scheduler_celery_worker-1","source":"stderr"}
2024-09-04 12:19:26 2024-09-04 06:49:26.000000000 +0000 workflow_scheduler_celery_worker: {"container_name":"/playbooks-workflow_scheduler_celery_worker-1","source":"stderr","log":"[2024-09-04 06:49:26,056: INFO/ForkPoolWorker-8] Task executor.workflows.tasks.workflow_scheduler[7f5315fa-9100-47b6-819d-366b89d1d3d0] succeeded in 0.053073333998327143s: None","container_id":"2fcf24a056d26fe7f5702f9ec41cd1464ea5945a32d0adfbeb30f96acc3e33b3"}
2024-09-04 12:19:36 2024-09-04 06:49:36.000000000 +0000 celery_beat: {"container_id":"f5cc7392edd76fa9fb74bdd7770c8293052deebe0c540a5b7efe49319ead84f0","container_name":"/playbooks-celery_beat-1","source":"stderr","log":"[2024-09-04 06:49:36,004: INFO/MainProcess] Scheduler: Sending due task workflow-scheduler-job-every-10-seconds (executor.workflows.tasks.workflow_scheduler)"}
2024-09-04 12:19:36 2024-09-04 06:49:36.000000000 +0000 workflow_scheduler_celery_worker: {"container_id":"2fcf24a056d26fe7f5702f9ec41cd1464ea5945a32d0adfbeb30f96acc3e33b3","container_name":"/playbooks-workflow_scheduler_celery_worker-1","source":"stderr","log":"[2024-09-04 06:49:36,042: INFO/MainProcess] Task executor.workflows.tasks.workflow_scheduler[ed657f22-fd8b-4a1d-a5f7-6d57b12fe126] received"}
2024-09-04 12:19:36 2024-09-04 06:49:36.000000000 +0000 workflow_scheduler_celery_worker: {"source":"stderr","log":"[2024-09-04 06:49:36,081: INFO/ForkPoolWorker-8] Task executor.workflows.tasks.workflow_scheduler[ed657f22-fd8b-4a1d-a5f7-6d57b12fe126] succeeded in 0.031065625000337604s: None","container_id":"2fcf24a056d26fe7f5702f9ec41cd1464ea5945a32d0adfbeb30f96acc3e33b3","container_name":"/playbooks-workflow_scheduler_celery_worker-1"}
Helm Charts
Run the following command to access the centralised logs:
kubectl logs central-log-pod -f
Note: Add your namespace as suffix in case its not the default one.
Updated about 2 months ago