{ "info": { "author": "Aryeh Leib Taurog", "author_email": "python@aryehleib.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Topic :: Database", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Logging" ], "description": "django-shoogie\r\n=================\r\n\r\nShoogie is a small django application for logging exceptions\r\nto a table in the database, along with django's standard HTML debug\r\nresponse. It is intended to be a lightweight alternative to\r\n`django-sentry`_, inspired by `this answer on stackoverflow`_.\r\n\r\nShoogie has been used in production since March 2012.\r\n\r\nThe name Shoogie is a diminutive of the Hebrew word *sh'giah* (\u05e9\u05d2\u05d9\u05d0\u05d4), which means\r\n'error.' *Shoogie* (\u05e9\u05d5\u05d2\u05d9) also happens to be the name of a popular kids' candy snack in\r\nIsrael. It's our hope that django-shoogie will make dealing with server errors a\r\nsweeter experience.\r\n\r\n.. _this answer on stackoverflow: http://stackoverflow.com/questions/7130985/#answer-7579467\r\n\r\nKey Features\r\n--------------\r\n* Simple, server-error specific logging\r\n* Logs django's familiar technical 500 response\r\n* Uses django's standard admin interface\r\n* Easy retrieval by user, exception, file, function\r\n* Easy extraction of users' email addresses\r\n* Logging handler operates outside transaction management\r\n* Configurable exception ignores\r\n* Configurable traceback filtering\r\n\r\nVersion Compatibility\r\n---------------------\r\n\r\ndjango-shoogie is compatible with Django versions 1.3 to 1.6\r\n\r\nInstallation \r\n------------\r\n\r\nTo install shoogie::\r\n\r\n pip install django-shoogie\r\n\r\nTo use shoogie in a django project, add it to the ``INSTALLED_APPS`` and\r\nadd the shoogie logging handler to ``LOGGING`` in your ``settings.py``. as\r\nbelow. You must add an entry for the shoogie handler to the ``handlers`` section,\r\nand then add it to the list of handlers for the ``django.request`` logger.\r\n\r\nMake sure to run ``syncdb`` after adding shoogie to create the\r\n``shoogie_servererror`` table.\r\n\r\nDepending on which Django version you use, and your particular setup,\r\nyour logging configuration may look different than this.\r\nThe Shoogie-specific additions are indicated with comments.\r\n\r\nThe ``django.contrib.admin`` app must also be installed to view\r\nthe errors logged via django's admin interface::\r\n\r\n INSTALLED_APPS = (\r\n 'django.contrib.auth',\r\n 'django.contrib.sessions',\r\n 'django.contrib.admin',\r\n 'django.contrib.admindocs',\r\n 'shoogie', # <---\r\n # ...\r\n )\r\n\r\n LOGGING = {\r\n 'version': 1,\r\n 'disable_existing_loggers': False,\r\n 'filters': {\r\n 'require_debug_false': {\r\n '()': 'django.utils.log.RequireDebugFalse',\r\n },\r\n },\r\n 'handlers': {\r\n # THIS IS THE HANDLER TO ADD #\r\n 'shoogie': {\r\n 'level': 'ERROR',\r\n 'filters': ['require_debug_false'],\r\n 'class': 'shoogie.log_handler.DatabaseLogHandler',\r\n },\r\n 'mail_admins': {\r\n 'level': 'ERROR',\r\n 'filters': ['require_debug_false'],\r\n 'class': 'django.utils.log.AdminEmailHandler',\r\n },\r\n },\r\n 'loggers': {\r\n 'django.request': {\r\n # THIS IS WHERE TO SPECIFY THE NEW SHOOGIE HANDLER #\r\n 'handlers': ['shoogie', 'mail_admins'],\r\n 'level': 'ERROR',\r\n 'propagate': True,\r\n },\r\n },\r\n }\r\n\r\n.. note::\r\n\r\n The require_debug_false filter is available in Django >= 1.4.\r\n\r\n Django 1.3 never logs 500 server errors if DEBUG=True.\r\n\r\nUpgrading from shoogie 0.6\r\n'''''''''''''''''''''''''''\r\n\r\nShoogie 0.7 uses a logging handler instead of middleware.\r\nShoogie's middleware still works, but switching to the logging handler\r\nconfiguration is recommended. Remove the Shoogie middleware from\r\n``MIDDLEWARE_CLASSES`` in settings.py and follow the logging configuration\r\ninstructions above. If both the middleware and the logging handler are\r\nconfigured, every error will be logged twice!\r\n\r\nConfiguration\r\n---------------\r\n\r\nShoogie can be configured with the following settings:\r\n\r\nsettings.SHOOGIE_IGNORE_EXCEPTIONS\r\n'''''''''''''''''''''''''''''''''''\r\nA sequence of absolute dotted paths of exceptions which it should not log.\r\nThese exceptions and their subclasses will be ignored.\r\nThe default value is::\r\n\r\n SHOOGIE_IGNORE_EXCEPTIONS = (\r\n 'django.http.Http404',\r\n 'django.exceptions.PermissionDenied',\r\n )\r\n\r\nsettings.SHOOGIE_TRACEBACK_EXCLUDE\r\n''''''''''''''''''''''''''''''''''''\r\nA sequence of regular expression pairs (filename, funcname) used to filter\r\nthe traceback included in django's debug page. This is intended to\r\neliminate the time needed to render, store, and display traceback frames\r\nwhich aren't useful. The default value is::\r\n\r\n SHOOGIE_TRACEBACK_EXCLUDE = (\r\n ('/django/core/handlers/base.py$', '^get_response$'),\r\n ('/django/template/', 'render'),\r\n )\r\n\r\nUse\r\n----\r\n\r\nErrors logged by shoogie can be viewed via django's admin interface at\r\n``/admin/shoogie/servererror/``.\r\n\r\nTo view the data fields stored in the log entry, click in the first column.\r\n\r\nTo visit the url in which the error occurred, click the 'path' column.\r\nThis won't work if the host is inaccessible, if the request method was\r\nsomething other than GET, or if the path isn't really an HTTP request path\r\n(see below).\r\n\r\nIf a user is logged with an entry, a link to the admin detail page for the\r\nuser will be displayed in the admin list.\r\n\r\nClick the 'debug' link to view the django-generated 'technical response'\r\n(debug page) for the exception.\r\n\r\nTo get a list of users and email addresses who encountered a set of errors,\r\nselect the log entries using the checkboxes on the left, then select \"Get\r\nuser email addresses for selected errors\" from the 'Action' drop-down menu\r\nand click the 'Go' button.\r\n\r\nTo mark a set of errors as resolved or as not resolved, select the entries\r\nin question and pick the appropriate action from the drop-down as above.\r\n\r\nAPI\r\n---\r\n\r\nShoogie can also be used to log exceptions directly. This could be useful\r\nfor exceptions occurring in back-end processes such as long-running\r\ncalculations, cron-jobs, and celery workers::\r\n\r\n from shoogie import logger\r\n logger.log_exception([request, [exc_type, exc_val, tb]])\r\n\r\nLogs an exception to the db. If ``exc_type``, ``exc_val``, and ``tb``\r\naren't supplied, they will be retrieved using ``sys.exc_info()``.\r\nThe django technical debug page stored will display the traceback as with\r\nerrors occuring in normal views.\r\n\r\nIf ``request`` is given, whatever request information is present will also\r\nbe saved in the log entry. ``request`` should be an object which implements,\r\npartially or wholly, the same interface as a ``django.http.HttpRequest``.\r\n\r\nFor conveniently logging exceptions outside the context of an HTTP\r\nrequest, ``log_exception`` can be passed a string instead, which will be\r\nlogged as the request path. Make sure the logging is done outside any\r\ntransaction which might be reversed by the exception being logged. A\r\ngeneral pattern as follows is recommended::\r\n\r\n try:\r\n with transaction.commit_on_success():\r\n \"insert your processing here\"\r\n except:\r\n logger.log_exception('Description')\r\n\r\nAs of version 0.7 it is possible to log errors to shoogie via the standard\r\n``logging`` module, using any logger for which shoogie is configured as a\r\nhandler. For example, with the logging configuration described in\r\nInstallation_, above, the ``django.request`` logger can be used to both log\r\nan exception to shoogie and send email to the admins::\r\n\r\n import logging\r\n django_logger = logging.getLogger('django.request')\r\n django_logger.error('Description', exc_info=True)\r\n\r\nRelated Projects\r\n-----------------\r\n\r\n`django-sentry`_ is a large, very full-featured multi-platform error logging server,\r\nwhich is based on django, and which offers prepackaged integration with\r\nmany other platforms. It offers some advanced features including aggregation of similar\r\nexceptions, graphs, a fully web-2.0 real-time AJAX interface, and much more.\r\n\r\nraven_ is the python logging client for django-sentry.\r\n\r\n`django-erroneous`_ is a very simple logging system, similar in scope to\r\ndjango-shoogie. It uses django signals rather than middleware to capture\r\nexceptions.\r\n\r\n`django-logdb`_ provides a handler for python's logging_ module which\r\nstores log messages in the db. It includes middleware for exception logging. \r\nIt also provides aggregation and some of the features offered by django-sentry.\r\n\r\n\r\n.. _django-sentry: http://pypi.python.org/pypi/django-sentry\r\n.. _raven: http://pypi.python.org/pypi/raven\r\n.. _django-erroneous: http://pypi.python.org/pypi/django-erroneous\r\n.. _django-logdb: http://pypi.python.org/pypi/django-logdb\r\n.. _logging: http://docs.python.org/2/library/logging.html", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/altaurog/django-shoogie", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-shoogie", "package_url": "https://pypi.org/project/django-shoogie/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-shoogie/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/altaurog/django-shoogie" }, "release_url": "https://pypi.org/project/django-shoogie/0.8/", "requires_dist": null, "requires_python": null, "summary": "Log server errors to database", "version": "0.8" }, "last_serial": 1335096, "releases": { "0.6": [ { "comment_text": "", "digests": { "md5": "4e8443b6f5dae502d1faeee94f36561e", "sha256": "7bdc98bdea6bf9e2badfd552d0b4a0c6717c50c9d90b47cb387ca6fb58b8085a" }, "downloads": -1, "filename": "django-shoogie-0.6.tar.gz", "has_sig": false, "md5_digest": "4e8443b6f5dae502d1faeee94f36561e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11193, "upload_time": "2014-06-05T17:05:31", "url": "https://files.pythonhosted.org/packages/59/48/4c9d8f5e9a9bde13065ad5656d5d6dd8221a474c5c8fafb59df398a115c3/django-shoogie-0.6.tar.gz" } ], "0.6b": [ { "comment_text": "", "digests": { "md5": "ef47963ad9a9a1e9ec7949ce3704caa2", "sha256": "1082496b7f2f31f83e739e025523e52c0e384d9cb315099ba78ce7a285cb56f2" }, "downloads": -1, "filename": "django-shoogie-0.6b.tar.gz", "has_sig": false, "md5_digest": "ef47963ad9a9a1e9ec7949ce3704caa2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10326, "upload_time": "2013-11-17T20:55:35", "url": "https://files.pythonhosted.org/packages/09/d2/4fa2947e8658cde7f1604147d10c91fe69b5be4c21022a7c15b2c5fc0b50/django-shoogie-0.6b.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "ffde1cb944d4bffc1a451eee0f8d7e7b", "sha256": "ad7f29440b940d82f1e3f76a087c07e56eca35b77fa7609e45e87d7c44d34f08" }, "downloads": -1, "filename": "django-shoogie-0.7.tar.gz", "has_sig": false, "md5_digest": "ffde1cb944d4bffc1a451eee0f8d7e7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12577, "upload_time": "2014-07-03T15:03:15", "url": "https://files.pythonhosted.org/packages/b7/28/d0538737dcdcf8b38d5898a9a04e71bddb2ec8f18c9a5eec2b8328387e5e/django-shoogie-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "dd86a96806d82b0d6f28f186479d9238", "sha256": "5bd845592c7ad6a6504b53adea80bcd2c34aa6876f56666b7f3dbd4a0f3d9db6" }, "downloads": -1, "filename": "django-shoogie-0.8.tar.gz", "has_sig": false, "md5_digest": "dd86a96806d82b0d6f28f186479d9238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12507, "upload_time": "2014-12-08T08:56:23", "url": "https://files.pythonhosted.org/packages/24/cb/0477926bd28ea87ab65f0f9f0c2326793c7543bd511aa770b418f4349777/django-shoogie-0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dd86a96806d82b0d6f28f186479d9238", "sha256": "5bd845592c7ad6a6504b53adea80bcd2c34aa6876f56666b7f3dbd4a0f3d9db6" }, "downloads": -1, "filename": "django-shoogie-0.8.tar.gz", "has_sig": false, "md5_digest": "dd86a96806d82b0d6f28f186479d9238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12507, "upload_time": "2014-12-08T08:56:23", "url": "https://files.pythonhosted.org/packages/24/cb/0477926bd28ea87ab65f0f9f0c2326793c7543bd511aa770b418f4349777/django-shoogie-0.8.tar.gz" } ] }