简体   繁体   中英

Kubernetes pods logs are not getting by kubectl logs command

I am using a WordPress site build with Kube.netes deployment. In the deployment I have only one container pod. Could you please clarify the possible reasons on the logs are not getting via kubectl logs command. I have tried docker logs on the container also, which is also showing the same output.

#~$ kubectl logs -f <pod_name> -n <namespace>
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using xx.xx.xx.xx. Set the 'ServerName' directive globally to suppress this message

This is the only content in logs even after accessing the domain.

# docker logs -f <k8s_container_name>
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using xx.xx.xx.xx. Set the 'ServerName' directive globally to suppress this message

kubectl logs show the default STDOUT and STDERR

You need to write the file_put_contents('php://stderr', 'Your text goes to STDERR',FILE_APPEND);

at least append in file and you read from there or else if you developing php WordPress you can push logs to external logging also.

Read more at: https://www.php.net/manual/en/features.commandline.io-streams.php & https://docs.docker.com/config/containers/logging/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM