How to send logs to a different location : Kubernetes

559 Views Asked by At

So I want to develop multiple flavors of log one for generic use and other for performing a specific operation

I want to separate those logs by storing them in a different location and using them for further processing.

I can see the logs in Kubernetes clusters are stored in nodes - /var/log/container/.log. How can I store specific logs in a separate place (maybe something like /var/log/container/specificoperation/.log.) What changes I need to do in kubernetes architecture to make this happen

Library I am using for logging: https://github.com/uber-go/zap

1

There are 1 best solutions below

3
On

One common architecture is to install a node-level collector as a daemon set, for example filebeat, direct the collector's output to logstash, then use logstash pipeline rules to selectively direct logs to the final destinations.