Open Naveen-LinuxAwsguy opened 3 weeks ago
For log persistence, I recommend installing logs aggregation tool like Grafana Loki or ELK (Elasticsearch + Fluentbit + Kibana) . You get logs aggregated in a single database that can be effectively filtered and searched.
Sure, you can mount var/log
and var/reports
to a volume, similar topub/media
: https://github.com/KiweeEu/magento2-on-kubernetes/blob/3b437451fb65e99d30ae9174cb682c3e03ba2229/deploy/bases/app/magento-web.yaml#L200-L203
You can either use a different subPath
or create a new PVC altogether.
However, this project is set up in such a way, that all Magento logs are automatically included in container (Pod) logs. We're using a module for that: https://github.com/KiweeEu/magento2-on-kubernetes/blob/3b437451fb65e99d30ae9174cb682c3e03ba2229/src/composer.json#L24
This is the recommended way of handling application logs: https://12factor.net/logs
These logs are then collected, stored, and managed by a dedicated log aggregation system such as EFK stack, ELK stack, Loki, or a specific solution offered by your cloud provider. See https://www.cncf.io/blog/2023/07/03/kubernetes-logging-best-practices/ for a general overview of how log aggregation works in Kubernetes.
where will be php-fpm & php logs will be stored if we want view this
PHP, PHP-FPM, Nginx and Magento logs are all forwarded to container stdout
.
To view the logs run kubectl logs -n <namespace_name> <pod_name>
.
In order to store these logs, you'll need to have log aggregation set up as outlined in my previous comment.
can we use any PVC path for persistence of logs , including every log