The following code is used to fetch logs from app engine for further processing. However I do not know how to use the result of logservice.fetch to access log messages now??
import cgi
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.api.logservice import logservice
logservice.AUTOFLUSH_ENABLED = False
class MainPage(webapp.RequestHandler):
def get(self):
requestlogs = logservice.fetch(start_time=1332200000, end_time=1332249954, offset=None, minimum_log_level=logservice.LOG_LEVEL_INFO, include_incomplete=False, include_app_logs=True, version_ids=None, batch_size=None)
self.response.out.write(requestlogs)
c=0
for iter in requestlogs:
c=c+1
print c
application = webapp.WSGIApplication([('/logs', MainPage)], debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
In your case, the code would look something like this:
A couple of comments..