javadockerkuberneteskubernetes-pvc

How to sending logs from application to pvc volume mount that is attached to kubernetes pod?


I want to send some logs from the docker containerized spring boot application that is running as a Kubernetes pod to the PVC volume mount that is attached to the Kubernetes same pod. The logs could be some app logs generated by the Java code. Any idea how do I proceed with this approach?


Solution

  • You can do this by logging to files located on the mounted volume.

    But in Kubernetes you typically log to stdout and retrieves the logs from a centralized log system - collected from all your nodes in your cluster.