'Why does GCP Cloud Functions log two blank lines?
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"))
}
Update: Google silently fixed the issue:
Update2: The problem is back.
Solution 1:[1]
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)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |