Search code examples
logginglog4jkubernetes

log4j container logging on Kubernetes


Does anyone know how to redirect log4j logs to central Kubernetes logging

Testing on GKE right now but as I understand Kubernetes uses Fluentd by default, doesn't it?

Thanks for help.


Solution

  • All you have to do is configure log4j to send its logs to stdout and/or stderr. That'll cause them to be shipped to whichever central logging service your cluster was configured with (Google Cloud Logging if you're on GKE).