问题
Recently I did an upgrade on my cluster that's running multiple containers for microservices written in Java (using default Spring Boot's log4j2 default configuration). Since then, the container log is not being updated anymore. The kubectl logs command is working fine, all the recent logs can be seen using this command, but the logs that should be appearing in the GKE dashboard is simply not working anymore. I checked the Google's Loggin API and it's enabled.
Does anyone know what's the possible reasons for this or how to solve it?
回答1:
The solution was to disable the Legacy Stackdriver and enable Stackdriver Kubernetes Engine Monitoring:
- Go to the cluster page and click on edit;
- Disable both Legacy Stackdriver Monitoring and Logging;
- Enable Stackdriver Kubernetes Engine Monitoring using the option "System and workload logging and monitoring"
来源:https://stackoverflow.com/questions/60175119/container-logs-not-working-after-cluster-update-on-gke