We have an application running in a Docker container, within Kubernetes, but because of certain limitations we can't change the application to log to stdout & stderr. This means when the app fails and triggers a container restart we lose any logs that could help us diagnose the issue. The application writes to a directory path within the container.
Two possibilities that we are wanting explore:
- Having the directory being written to be a mounted persistent volume, that we can look at even when the container gets restarted
- Have the latest log file created (rolling logs) be tailed and redirected to stdout
Right now I am wanting to explore the first of the two options, since it should allow us to see the failure state even once the container gets restarted. I will explore the second option in parallel.
Any suggestions how to approach the first option? We are using Digital Ocean, and the latest version of Kubernetes, if that changes anything.