If you use Apps Script, then you may be logging information or errors to Stackdriver. But how can you do something like delete logs that you no longer care about? Well, you can do that with the Google Cloud SDK command line tool. The Cloud SDK can also access and manage other Google Cloud Services. The Google Cloud SDK runs from your computer. It requires Python. It's free. When looking at the documentation, you may see statements that you must enable a Cloud Billing Account. For use with Apps Script, I don't have a Cloud Billing Account. I have a GCP project associated with my Apps Script project in order to publish an add-on, and I have never enabled a Cloud Billing Account.
Just for fun, I downloaded the Google Cloud SDK and deleted all the Stackdriver logs of a specific LOG_NAME. Now all my Stackdriver log entries are gone. Of course, I will continue to get new ones when there are code failures.
I'm using a windows machine, so I decided to try using the Windows Power Shell for the installation, rather than downloading the file. It worked well.
It took me a long time to figure out what the LOG_NAME setting was. It's a URL that I found in the data of an individual error log.
There are lots of Google Cloud SDK commands because it covers multiple products in the Google Cloud Platform. I used the gcloud logging commands.
I didn't need to delete those logs, and I don't have billing enabled, so I'm not going to get billed, but having some experience with the Google Cloud SDK might be something good to know. I just hate the thought of all that log data being stored for no reason. I'm not going to use it. I look at the most recent logs once, and then never again.
![Google Cloud SDK setup.png](https://groups.google.com/group/google-apps-script-community/attach/111f20be408dfe/Google%20Cloud%20SDK%20setup.png?part=0.1&view=1)
![Cloud SDK has been installed.JPG](https://groups.google.com/group/google-apps-script-community/attach/111f20be408dfe/Cloud%20SDK%20has%20been%20installed.JPG?part=0.2&view=1)
![Google Cloud SDK authorize.JPG](https://groups.google.com/group/google-apps-script-community/attach/111f20be408dfe/Google%20Cloud%20SDK%20authorize.JPG?part=0.3&view=1)
![Google Cloud SDK success.JPG](https://groups.google.com/group/google-apps-script-community/attach/111f20be408dfe/Google%20Cloud%20SDK%20success.JPG?part=0.4&view=1)