{ "info": { "author": "Jay Young(yjmade)", "author_email": "dev@yjmade.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "django-errorlog\n===============\n\nDjango reuseable app to collect the unexpcted exception then generate\ncomprehansive report just like what you get in debug mode and store in\ndatabase\n\nIntroduction\n============\n\nDjango has it's own error handling machanism, which will send a email to\nthe admin address configed in the settings. It works but there are some\nshortage.\n\n1. The stack trace include in the email is as same as what you can see\n in console. It doesn't contains the varible value which can be very\n useful to debug.\n\n2. Incovinient to trace the errors, it's a email, hard to catoegorized,\n and hard to track the status.\n3. Some times one same error will bring you thousands of emails if this\n api happens to be visit a lot. You will waste a lot of time to find\n the different errors from the error happens most.\n\nThis module solves these problem in the following way.\n\n1. We are love the Django buildin debug 500 page, it's contains almost\n all the information we need to debug, like the request infomation,\n the user, the settings, the stack trace with local vars, etc. So what\n we do, is to have a middleware to capture the unhandle exception then\n simply invoke the Django buildin reporter class to generate the full\n html report of the exception, then store in the database.\n2. Each error item have the field to record a. fixed b. vcs\n version(support hg and git), you can ``ignore`` it after this bug has\n been addressed. Then it will gone from the ``unfixed_error`` list.\n3. Errors will be categoried by the type of exception and the location\n where the exception been raised (location means the python file path\n and the method name). So in most case, same error that happened\n multiple times will be showed only once but with the count of how\n many times it's happend. Then when the error been ignore, all the\n same error will been marked as ignored.\n\nThis Module has been running in my company's website for more than 1\nyear and helps to solved thousands of bugs.\n\nChange Logs\n===========\n\n2016-12-04: 0.1.0 Initial submit. Split the code from the online\nproject. Write the documents, and add the tests.\n\nInstall\n=======\n\n.. code:: bash\n\n pip install django-errorlog\n\nThen modify the settings\n\n1. add ``errorlog`` in the INSTALLED\\_APPS\n2. if you are using django>=1.10, insert\n ``errorlog.middlewares.ErrorLogMiddleware`` in the ``MIDDLEWARES`` at\n the first line.\n3. (optional) if you have your django project live inside a VCS(hg or\n git), set ``VCS_SYSTEM = \"hg\"`` or ``VCS_SYSTEM = \"git\"`` to enable\n the erro rev tracking.\n\nThen do ``python manage.py migrate`` to setup the database table.\n\nThen when your views get an 500 error, there will be a new log item\nstored.\n\nUsage\n=====\n\nbuildin shell command\n---------------------\n\n.. code:: python\n\n >>> from errorlog.models import Error\n >>> Error.unfixed_errors\n {0: ,\n 1: }\n >>> error = Error.unfixed_errors[1]\n >>> error\n 1: \n >>> # in this repr, the first number is the index to make it easy to select; \n >>> # the second number 4 is the the count of the same error happened;\n >>> # /test/1/ is the uri of the api;\n >>> # ValueError is the exception type; \n >>> # B is the args in the exception.\n >>> error.vcs_rev # the git/hg version of error, for hg, it's the incremental number that is orderable\n \"1\"\n >>> error.ignore() # this command ignore the whole 4 error logs\n\nDjango admin\n------------\n\nIf you use django buildin admin, you should be able to find the Error in\nthe home page.\n\nIf you want to see the html error report, you need to build the view\nyouself to transfer the error\\_html to the browser.\n\nAdvance Usage\n-------------\n\nYou can use Error.log\\_exception to log one specific error in one\ncertain scope.\n\n.. code:: python\n\n from errorlog.models import Error\n with Error.log_exception(\"name\", reraise=False):\n do_something_here()\n\nIf ``reraise = True``, then after being loged, the exception will keep\nraising out. Caution, if you have database atomic open, since unhandle\nerror will make django to rollback the transaction, so this log will\nalso been rollbacked.\n\nIf ``reraise = False``, then it will log the exception then stop\npropogation and continue to run the following code. It's as same as the\nfollowing code\n\n.. code:: python\n\n try:\n do_something_here()\n except Exception as e:\n pass\n\nHere is an example of how I using it\n\n.. code:: python\n\n with Error.log_exception(\"send_email_through_mailgun\", reraise=False):\n response=requests.post(url,parms)\n content=response.content\n status_code=response.status_code\n if status_code!=200:\n raise ValueError(\"Mailgun failed\")\n other_stuff()\n\nSo that I can capture when the mailgun's api return an error, and keep\nthe stuff going.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yjmade/django-errorlog", "keywords": "django error log report", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-errorlog", "package_url": "https://pypi.org/project/django-errorlog/", "platform": "", "project_url": "https://pypi.org/project/django-errorlog/", "project_urls": { "Homepage": "https://github.com/yjmade/django-errorlog" }, "release_url": "https://pypi.org/project/django-errorlog/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Django reuseable app to collect the unexpcted exception then generate comprehansive report just like what you get in debug mode and store in database", "version": "0.1.1" }, "last_serial": 2500327, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a9b471588b69e381801ea656a3cbf778", "sha256": "be14b6d48b6d9545fa892c7536e1f25770e7649cc768b3f4144238b2db26078e" }, "downloads": -1, "filename": "django-errorlog-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a9b471588b69e381801ea656a3cbf778", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7123, "upload_time": "2016-12-04T14:20:59", "url": "https://files.pythonhosted.org/packages/8c/e4/cabece9795cf64eebb4e3e1f6863df9fbd74c0434ebb93bb1dfb467c6cc5/django-errorlog-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "58d3e8e71fee00c3640e1d80ad45d060", "sha256": "c0c2c9a76f0c5406841b5125f210602969f4e5a993194617b01afee2a2b75c20" }, "downloads": -1, "filename": "django-errorlog-0.1.1.tar.gz", "has_sig": false, "md5_digest": "58d3e8e71fee00c3640e1d80ad45d060", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13257, "upload_time": "2016-12-05T13:53:14", "url": "https://files.pythonhosted.org/packages/ae/08/4f9e97a2c3bcba20864cc43e78a3094b7364af004135b85d3c9da96911b8/django-errorlog-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "58d3e8e71fee00c3640e1d80ad45d060", "sha256": "c0c2c9a76f0c5406841b5125f210602969f4e5a993194617b01afee2a2b75c20" }, "downloads": -1, "filename": "django-errorlog-0.1.1.tar.gz", "has_sig": false, "md5_digest": "58d3e8e71fee00c3640e1d80ad45d060", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13257, "upload_time": "2016-12-05T13:53:14", "url": "https://files.pythonhosted.org/packages/ae/08/4f9e97a2c3bcba20864cc43e78a3094b7364af004135b85d3c9da96911b8/django-errorlog-0.1.1.tar.gz" } ] }