Enforce Logging Format in GCP Cloud Logging

Hello,

We have Open Shift cluster running on GCE which hosts various Applications and Middleware components i.e. Elasticsearch, Kafka, key Cloak, Micro Services (Java and Python based) and BPO.

All logs from the Open Shift cluster are being forwarded to Cloud Logging. 

We are looking to enforce logging format standard so that all application and middleware components adhere to logging standards.

Logging Format : <timestamp><log_level><Application_name>

Log level could be INFO, DEBUG, ERROR etc.

Please let me know if there are ways to enforce from GCP.

Thanks

0 1 277
1 REPLY 1

Hello @singh_raj08 ,

Welcome to the Google Cloud Community.I'm assuming that for GC you are using fluentd and fluentdForward.  So based on that I would try to deal with fluentd config with [1]this document and [2] this tutorial ( tutorial is for GKE, however if you are using fluentd, imho is not to hard adjust this for OC). This instruction is related with IBM Cloud, however is showing how to update fluentd config map, so I believe that it worth to check it. 

 

[1]. https://cloud.google.com/logging/docs/agent/logging/configuration

[2]. https://cloud.google.com/architecture/customizing-stackdriver-logs-fluentd

[3] https://www.ibm.com/docs/en/cloud-paks/cp-network-auto/2.4.x?topic=efk-updating-fluentd-configuratio...

cheers,
DamianS