/var/log/overleaf/; kubectl logs shows only the container’s startup output (init scripts, migrations). The Toolkit’s bin/logs reads the same files, see Logging.
Reading logs
With several replicas, each pod has its own files: use the pod name (
overleaf-0, overleaf-1, …) instead of deploy/overleaf. The X-Served-By header that HAProxy adds tells which replica answered a request.
LOG_LEVEL in the ConfigMap (default info, also debug, warn, error) sets the level of every service in the pod at once.
Keeping logs
The files live in the container and are lost when the pod is replaced. To keep them, mount a volume at/var/log/overleaf, for example a hostPath on the node or a PersistentVolumeClaim, in the Deployment or StatefulSet:
Tested on Kubernetes
On Kubernetes 1.37 with three replicas and ahostPath volume at /var/log/overleaf as above, each node’s /srv/overleaf-logs held the twelve service logs of its replica, and the commands in the table worked as shown: tail through kubectl exec, kubectl cp of a log file, kubectl logs of the Overleaf pod (startup and migrations) and of mongo-0.
