Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete logs from Firebase Cloud Functions

I was just playing around with Cloud Functions on Firebase and deployed some random functions to test it out. Now I want to delete all logs on Firebase console but I was not able to find a way for that. Is there any CLI command to do that or is it going to be there for ever or they will be automatically deleted as they age?

like image 337
Mark.Ben Avatar asked Feb 13 '18 22:02

Mark.Ben


2 Answers

That's just an addition to @Kiana answer.

You can see it directly within the Firebase console. When trying to choose the timestamp for the logs, logs older than 1 month are disabled, which means are automatically deleted. At least for project's owner, maybe Google stores it somewhere deeper in their logs.

Still, there's no option to delete the logs manually.

Edit: maybe it's good to add, but even if you'll delete your function, the logs of the deleted function still will be there for 1 month.

Firebase console

like image 200
Daniel Danielecki Avatar answered Oct 29 '22 13:10

Daniel Danielecki


Cloud Functions log retention is based on the standard Stackdriver limits. For free projects, logs are kept for 7 days. If you upgrade your stackdriver plan it's 30 days.

You can use Stackdriver's deletion api to delete the log entries. The log name for cloud functions should look similar to: projects/<project-id>/logs/cloudfunctions.googleapis.com%2Fcloud-functions" and can be found using the list api

like image 34
Kiana Avatar answered Oct 29 '22 13:10

Kiana