Managing Application Logs
- Take me to Video Tutorial
In this section, we will take a look at managing application logs
Let us start with logging in docker
Logs - Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: event-simulator-pod
spec:
containers:
- name: event-simulator
image: kodekloud/event-simulator
/images/logs-k8s.png)
-
To view the logs
$ kubectl logs -f event-simulator-pod -
If there are multiple containers in a pod then you must specify the name of the container explicitly in the command.
$ kubectl logs -f <pod-name> <container-name> $ kubectl logs -f even-simulator-pod event-simulator