Container Log Collection
Summary
This article covers how to collect logs from containers on Kubernetes or Docker and upload them to DH2i for support to analyze.
Information
- Kubernetes
- Docker
-
List the pods.
kubectl get pods
-
Collect the pod logs and output to file.
kubectl logs <pod_name> > <pod_name>.log
infoWith side-car container deployments, the name of the container is also required.
kubectl logs -c <dxe|sql> <pod_name> > <pod_name>.log
-
Upload the log file using DH2i Client Uploads (Requires client login).
-
List the containers.
docker ps -a
-
Collect the container logs using the container ID or name and output to a file.
docker logs <container_name> > <container_name>.log
-
Upload the log file using DH2i Client Uploads (Requires client login).