2

In a Google Container Engine cluster all of the standard out of the pods are aggregated and send to Google Cloud Logging. This works out fine except you don't have any control over the logging meta data like

google.logging.v1.LogSeverity

Is their a way to enrich the logging output on "standard out/err" so that the fluentd daemon on each cluster node recognizes the log severity on each log line.

But without changing something in the fluentd daemon on each node (that would defy the purpose of running as a service) or adding a custom fluentd daemon in each pod.

alexvanboxel
  • 685
  • 6
  • 9

1 Answers1

1

Currently there's no way to do this with the default fluentd agents on each node. If you have suggestions on what the format(s) should be for a feature like this, we'd love your input! You can open an issue with your ideas here.

edit: Support for this was added as of Kubernetes version 1.1, which was released in Fall 2015. If you log a JSON payload with a "severity" field, that field's value will be used to populate cloud logging's severity field. You'll also probably want to populate the "message" field, which is assumed to contain the main body of the log message.

Alex Robinson
  • 12,633
  • 2
  • 38
  • 55
  • Thanks. At least I know it's not support for now and that it's a core kubernetes feature. I'll think about it and maybe it's a good idea for a pull request. – alexvanboxel Jun 24 '15 at 15:12
  • Updated the answer with the fact that we support this now (and have for a while, sorry for the late update!). – Alex Robinson Apr 07 '16 at 21:30
  • @AlexRobinson Can you expand on how you made the severity field work? My container is logging JSON objects to stdout with a severity field. But I only get INFO level log entries with the whole JSON string as the textPayload. – scoffey Aug 11 '17 at 01:37