Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.
https://nebo15.github.io/logger_json/
MIT License
237 stars 92 forks source link

Logs from LoggerJSON.Plug show as "" in Google Cloud Logging #70

Closed marceldegraaf closed 3 years ago

marceldegraaf commented 3 years ago

We're using Elixir/Phoenix and LoggerJSON in our Plug pipelines to format log lines for Google Cloud Logging. These log lines used to be shown with proper labels in the GCL summary line, using fields from httpRequest:

20201027133125-zsxruetksy

However, today we noticed these logs are no longer shown that way in GCL, instead showing up as an empty string ("") with no labels applied:

20210318164455-6n0pz1haa0

Expanding one of these log lines still shows the required httpRequest fields are present, but GCL seems to take the jsonPayload.message (which is logged as an empty string in LoggerJSON.Plug) and for some reason no longer shows the httpRequest labels:

20210318164659-x5uj18ov72

Things I've tried in a fork of LoggerJSON:

Is anyone else experiencing these issues, and do you have any idea how these log lines should be formatted to get proper formatting back in GCL?

marceldegraaf commented 3 years ago

Update: I've spent the last few hours debugging this, pouring over documentation and trying to add/remove various fields in LoggerJSON to see if that helps. No luck so far.

I've opened a support ticket at Google Cloud, to check if this is caused by a recent change on their end. Will update this issue as I learn more.

stevencorona commented 3 years ago

Happens for me as well

marceldegraaf commented 3 years ago

Google Cloud Support confirmed this was caused by an error in Google Cloud Logging and Google Kubernetes Engine. It seems to have been fixed in the latest GKE updates.