>>> from google.cloud.logging_v2 import LoggingServiceV2Client
>>> entries = LoggingServiceV2Client().list_log_entries(('projects/brid-gy',),
filter_='resource.type="gae_app" AND protoPayload.@type="type.googleapis.com/google.appengine.logging.v1.RequestLog"')
>>> print(next(iter(entries)))
proto_payload {
type_url: "type.googleapis.com/google.appengine.logging.v1.RequestLog"
value: "\n\ts~brid-gy\022\0018\032R5d..."
}
...
google.appengine.logging.v1.RequestLog protobuf generated class anywhere that I can use, if that's even the right idea. Has anyone done this?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ryan/src/bridgy/local/lib/python2.7/site-packages/google/cloud/logging/entries.py", line 357, in to_api_repr
info["protoPayload"] = MessageToDict(self.payload)
File "/Users/ryan/src/bridgy/local/lib/python2.7/site-packages/google/protobuf/json_format.py", line 168, in MessageToDict
return printer._MessageToJsonObject(message)
File "/Users/ryan/src/bridgy/local/lib/python2.7/site-packages/google/protobuf/json_format.py", line 202, in _MessageToJsonObject
return methodcaller(_WKTJSONMETHODS[full_name][0], message)(self)
File "/Users/ryan/src/bridgy/local/lib/python2.7/site-packages/google/protobuf/json_format.py", line 314, in _AnyMessageToJsonObject
sub_message = _CreateMessageFromTypeUrl(type_url, self.descriptor_pool)
File "/Users/ryan/src/bridgy/local/lib/python2.7/site-packages/google/protobuf/json_format.py", line 389, 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.google-api-core 1.14.3
google-api-python-client 1.7.11
google-auth 1.6.3
google-auth-httplib2 0.0.3
google-cloud-core 1.0.3
google-cloud-logging 1.14.0
googleapis-common-protos 1.6.0
oauth2client 4.1.3
>>> from google.cloud.logging import Client
>>> entries = Client().list_entries(
... ('projects/brid-gy',),
... filter_='resource.type="gae_app" AND protoPayload.@type="type.googleapis.com/google.appengine.logging.v1.RequestLog"'))
>>> entry = next(iter(entries))
>>> entry.to_api_repr()You can use the LogEntry.to_api_repr() function to get a JSON version of the LogEntry.
--
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 google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/a6665355-a7e6-42d4-96c2-82090d457adf%40googlegroups.com.
--
To unsubscribe from this group and stop receiving emails from it, send an email to google-a...@googlegroups.com.