Jsef bch
Jsef bch

Reputation: 81

Persist container logs after restart

I'm trying to persist the logs of a container that is running inside a docker stack I'm deploying the whole thing to the swarm using a .yml file but every solution I come across either does not work or I have to set it up manually like everytime I deploy the stack I have to mount manually. What would be the best way to persist the logs automatically without having to do it manually everytime? (Without Kibana etc..).

Upvotes: 1

Views: 618

Answers (2)

P Ekambaram
P Ekambaram

Reputation: 17621

Deploy EFK stack in the container platform. FLuentd is run as daemonset collecting the logs from all the containers from a host and feeds to elasticsearch. Using kibana you can visualize the logs stored in elasticsearch. With curator you can apply data retention policies depending on the amount of days you want to keep the logs.

Upvotes: 1

Nataraj Medayhal
Nataraj Medayhal

Reputation: 1221

Kubernetes Volumes can be referred to write the logs into persistent storage.

There are different solutions stacks for shipping, storing and viewing logs.

Upvotes: 0

Related Questions