Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 951 Bytes

File metadata and controls

39 lines (30 loc) · 951 Bytes

Managing Application Logs

In this section, we will take a look at managing application logs

Let us start with logging in docker

ld

ld1

Logs - Kubernetes

apiVersion: v1
kind: Pod
metadata:
  name: event-simulator-pod
spec:
  containers:
  - name: event-simulator
    image: kodekloud/event-simulator

logs-k8s

  • 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
    

    logs1

K8s Reference Docs