0
votes

Reference: https://cloud.google.com/logging/docs/reference/libraries#log-sinks

Apparently you can create a log sink and export logs to Cloud Storage.

But how does it work? What will be the exported format of those logs? Will I get 1 file per log entry? Will it be like a .txt file? What is the exported format?

From the documentation, this is not clear to me.

2

2 Answers

2
votes

The log format is in JSON, with one entry per line, and follow this format. Not really clear in the documentation, but you can find the information here

1
votes

Here is what I've found out:

When you select your project's bucket. A folder will be created with the same name as your logName (in my case, logName === admin-logs. And there will be folders for years, month and days. Like, today is 2021-02-26 and this was the result:

enter image description here

As per the file, a json file will be created. From the file name, I'm guessin the sink export will happen once every hour.