views:

74

answers:

3

Is there a project that can log errors in requests to Django on Google App Engine to the datastore (like django-db-log or django.crashlog)?

Thanks!

+1  A: 
  1. Check out Native Django on GAE. It's a non-relational port of Django to Google's App Engine.
  2. Another project, google-app-engine-django, looks like an intermediate "helper" to get you going, without the full port.
Wraith
@Wraith - Thanks for the suggestion. I'd rather avoid mediators just for this logging mechanism - it adds an awful lot of complexity and room for errors for one very specific use. But I appreciate the suggestion!
Brian M. Hunt
A: 

I've created a project Django-GAE-log to solve this issue. Thoughts and input are welcome!

Brian M. Hunt
You may want to take a look at the approach my ereporter module takes (see other answer): By registering a Python logging handler, you can capture all calls to logging.exception and process them as you wish.
Nick Johnson
@Nick Johnson: Great tip! Interestingly enough I was just perusing your blog for something on cursors+pagination. :) Thanks!
Brian M. Hunt
+2  A: 

Use the built-in google.appengine.ext.ereporter module:

A logging handler that records information about unique exceptions.

'Unique' in this case is defined as a given (exception class, location) tuple. Unique exceptions are logged to the datastore with an example stacktrace and an approximate count of occurrences, grouped by day and application version.

A cron handler, in google.appengine.ext.ereporter.report_generator, constructs and emails a report based on the previous day's exceptions.

See also: Using the ereporter module for easy error reporting.