gcloud bloats its log files - log level set to NOTSET

372 views
Skip to first unread message

Zaar Hai

unread,
Apr 24, 2016, 4:10:10 AM4/24/16
to google-cloud-sdk
I've noticed that every invocation of gcloud produces 500KB of log files under ~/.config/gcloud/logs/. There is no way to change it - "--verbosity" flag does not affect the log file level. 

glcoud removes logs only after 30 days (it's hard-coded at lib/googlecloudsdk/core/log.py:215) and having a cron job that runs once a minute, one will need 30GB of disk space just for logs.

I suggest fixing it to allow file logging to have the same level as console log (see the attached patch). At least, a user should be have an option to configure file logging - currently its level is simply hard-coded to NOTSET (i.e. all messages are logged).
logging.diff

Vilas Jagannath

unread,
Apr 25, 2016, 1:46:42 PM4/25/16
to google-cloud-sdk
Thank you for your feedback. This is a valid concern. We have filed a bug to provide more control on the number (and/or days) of log files that are retained. Unfortunately we cannot implement your patch because it will become harder to troubleshoot user issues without detailed info in the log files.

Vivek Dasari

unread,
Apr 29, 2016, 11:57:21 AM4/29/16
to google-cloud-sdk
I am also running into this same issue of gcloud writing too many logs to my home directory. I'd like to express my support for the following features to mitigate these bugs: 

1) Users can change their logging directory .
2) Users can change their logging verbosity.

Vilas Jagannath

unread,
Apr 29, 2016, 1:57:30 PM4/29/16
to google-cloud-sdk
Thanks for your feedback.

Btw, logs are created inside your config directory, which can be changed using the CLOUD_SDK_CONFIG environment variable.

Zaar Hai

unread,
Apr 29, 2016, 3:39:23 PM4/29/16
to Vilas Jagannath, google-cloud-sdk

I think that Vivek means only changing the log location directory, while keeping the rest of the (important) configuration in tact.

--
You received this message because you are subscribed to a topic in the Google Groups "google-cloud-sdk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sdk/TzZf0_iD8xg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-cloud-sdk.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sdk/5baed2f9-5ad2-4d9b-b554-75ffb46bb3f8%40googlegroups.com.

Vilas Jagannath

unread,
Apr 29, 2016, 3:42:50 PM4/29/16
to google-cloud-sdk, vil...@google.com
Acknowledged. The CLOUD_SDK_CONFIG suggestion was a workaround in case he was blocked by this right now.
Reply all
Reply to author
Forward
0 new messages