1

I created a trivial GoLang 1.16 GCP CloudFunction and deployed it. When I make a request to the endpoint, I see two blank lines in the log output. I can't figure out where they are coming from. Is this normal?

func TestHttp(w http.ResponseWriter, _ *http.Request) {
    w.WriteHeader(200)
    w.Write([]byte("ok response"))
}

image of the blank log lines

Update: Google silently fixed the issue:

image of the fixed log output

Update2: The problem is back.

image of the broken log output

Public Profile
  • 1,817
  • 1
  • 21
  • 20

1 Answers1

0

The closest answer to this “empty logs” would be caused by Audit Logs. These can be seen as the example you have provided. Here is a quick overview:

Google Cloud services write audit logs that record administrative activities and accesses within your Google Cloud resources. Audit logs help you answer "who did what, where, and when?" within your Google Cloud resources with the same level of transparency as in on-premises environments.

“Admin Activity” audit logs are enabled by default and cannot be disabled:

Admin Activity audit logs are always written; you can't configure, exclude, or disable them. Even if you disable the Cloud Logging API, Admin Activity audit logs are still generated.

You can check how to View runtime logs in case those could be identified as such. Inside the Writing, Viewing, and Responding to Logs page you can check the details.

This kind of behavior has been reported previously with different scenarios to this one:

  • First case, an issue was reported for duplicated logs so we can discard it might be one of these. Also, one of the answers suggests making a filter if possible for these.
  • And in this discussion, a user says that after a few months they have completely gone and there is no indication of an issue or unusual behavior caused by these in any of the both cases. (see questions: 58983677, 49506107)
Alex
  • 778
  • 1
  • 15
  • Thank you for your answer, I found those two reports, but there is a difference in my report. The other reports imply that someone is outputting extra log information by accident or in a format which StackDriver does not know how to process. In my case, there is no accident. These are also not runtime or audit logs as they provide no additional information than what is shown in the screenshot. – Public Profile Apr 26 '22 at 20:07
  • I have edited my answer, can you please take a look and provide feedback? – Alex Apr 29 '22 at 23:23
  • I appreciate your answer, but it is a red herring and didn't answer my original question at all, which turned out to be a bug that Google has silently fixed as the problem has magically disappeared. – Public Profile Apr 30 '22 at 17:31