Right now we cannot use the request_logs feature for downloading our GAE
logs (see my other thread on that problem!), so I thought I would try the
newer google.cloud features, and get modern :-)
Here is the simple test I tried:
from google.cloud import logging
from google.cloud.logging import DESCENDING
def main():
client = logging.Client()
for entry in client.list_entries(order_by=DESCENDING):
print entry
if __name__ == '__main__':
main()
When executing this (after setting up the gcloud credentials), there seems
to be a problem parsing the log entries:
python GetLogsCloud.py
Traceback (most recent call last):
File "GetLogsCloud.py", line 25, in <module>
main()
File "GetLogsCloud.py", line 18, in main
for entry in client.list_entries(order_by=DESCENDING):
File "c:\python27\lib\site-packages\google\cloud\iterator.py", line 219,
in _items_iter
for item in page:
File "c:\python27\lib\site-packages\google\cloud\iterator.py", line 163,
in next
result = self._item_to_value(self._parent, item)
File "c:\python27\lib\site-packages\google\cloud\logging\_gax.py", line
488, in _item_to_entry
resource = MessageToDict(entry_pb)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
133, in MessageToDict
return printer._MessageToJsonObject(message)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
164, in _MessageToJsonObject
return self._RegularMessageToJsonObject(message, js)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
196, in _RegularMessageToJsonObject
js[name] = self._FieldToJsonObject(field, value)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
230, in _FieldToJsonObject
return self._MessageToJsonObject(value)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
162, in _MessageToJsonObject
return methodcaller(_WKTJSONMETHODS[full_name][0], message)(self)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
266, in _AnyMessageToJsonObject
sub_message = _CreateMessageFromTypeUrl(type_url)
File "c:\python27\lib\site-packages\google\protobuf\json_format.py", line
341, in _CreateMessageFromTypeUrl
'Can not find message descriptor by type_url: {0}.'.format(type_url))
TypeError: Can not find message descriptor by type_url:
type.googleapis.com/google.appengine.logging.v1.RequestLog.
I'm wondering what the issue is here ... is it because of the type of
logging we use on GAE?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/67b5422c-6e56-48e5-84d5-545df3341849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.