{ "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-celery-errorlog\n======================\n\nReuseable app for django to collect the unexpted exception and generate\ncomprehansive report just like what you get in debug mode and store in\ndatabase from celery task\n\nIntroduction\n============\n\nThis is a extension of\n`django-errorlog `__ to\nbring support of celery task with some other features. I love Celery,\nbut sometimes when there are bugs hiding in the celery tasks code, and\nthe code has already running as deamon in the background of the\nproduction server, you will find it's hard to track and debug the error.\nMore importantly, when a unhandled exception happened, that's also means\nthe task failed, and the arguments send to this task will be losed. To\nsolve this problem, this app wrap you task function inside a database\ntransaction, when unhandled exception been catched by the wrapper, it\nwill do this following stuff:\n\n1. rollback this transaction\n2. get the exception and traceback to generate a HTML error report as\n same as the Django buildin 500 page when ``DEBUG=True``, which\n contains the stack trace also the varibles in each stack. That make\n it much easier to debug.\n3. record the arguments of this task\n4. get the error categorized\n\nSo, after error happened, you can check the\n``CeleryError.unfixed_errors``, then fix the code, restart the worker,\nthen run ``error.fix()`` to send this task back to the queue again to\nmake sure all task will be run.\n\nIf you do ``error.fix()`` before you fixed code in place, it's doesn't\nmatter, because even the old error has been mark as fixed, since the\nsame error will be raised again, so you will get new error with same\nparameters.\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-celery-errorlog\n\nThen modify the settings\n\n1. Follow the instruction of\n `django-errorlog `__ to\n set it up properly\n2. set up djcelery properly\n3. Add ``djcelery-errorlog`` into ``INSTALLED_APPS`` after ``errorlog``\n\nThen do ``python manage.py migrate`` to setup the database table.\n\nUsage\n=====\n\nIn tasks.py, you have to change the import of ``shared_task`` and\n``periodic_task`` from ``celery`` to ``djcelery_errorlog`` to make\nerrorlog work, here is the example\n\n.. code:: python\n\n # -*- coding: utf-8 -*-\n from djcelery_errorlog import shared_task\n\n\n @shared_task(name=\"tests\")\n def tests(**kwargs):\n raise ValueError(kwargs)\n\nThat's it, now when there is uncatched exception been throwed,\nCeleryError will record the invoke parameter and stack trace.\n\nbuildin shell command(same as django-errorlog)\n----------------------------------------------\n\n.. code:: python\n\n >>> from djcelery_errorlog.models import CeleryError\n >>> CeleryError.unfixed_errors\n {0: ,\n 1: }\n >>> error = CeleryError.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 >>> # test1 is the name of the task;\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\nFix the error\n-------------\n\nAfter you fixed the code base on the error been tracked, you can do\n``error.fix([queue=\"queue_name\"])`` to get the task with same parameter\nrun again. Remember, when you run fix on one error, all same errors will\nbe send to the celery worker and marked as fixed.\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-celery-errorlog", "keywords": "django celery error log report", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-celery-errorlog", "package_url": "https://pypi.org/project/django-celery-errorlog/", "platform": "", "project_url": "https://pypi.org/project/django-celery-errorlog/", "project_urls": { "Homepage": "https://github.com/yjmade/django-celery-errorlog" }, "release_url": "https://pypi.org/project/django-celery-errorlog/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Reuseable app for django to collect the unexpted exception and generate comprehansive report just like what you get in debug mode and store in database from celery task", "version": "0.1.1" }, "last_serial": 2500513, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "3a2b657ef92770a83b6f1a7968261625", "sha256": "28ebbca85089e31b802305207d2a5feb810d7af34cae4dfce02588dce5430ab8" }, "downloads": -1, "filename": "django-celery-errorlog-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3a2b657ef92770a83b6f1a7968261625", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4864, "upload_time": "2016-12-05T14:57:35", "url": "https://files.pythonhosted.org/packages/0e/e7/94d7c5f8dea4d0621ad16ff700a4a0e1363c9b78abd9a9b49fdb6cb9623b/django-celery-errorlog-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3a2b657ef92770a83b6f1a7968261625", "sha256": "28ebbca85089e31b802305207d2a5feb810d7af34cae4dfce02588dce5430ab8" }, "downloads": -1, "filename": "django-celery-errorlog-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3a2b657ef92770a83b6f1a7968261625", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4864, "upload_time": "2016-12-05T14:57:35", "url": "https://files.pythonhosted.org/packages/0e/e7/94d7c5f8dea4d0621ad16ff700a4a0e1363c9b78abd9a9b49fdb6cb9623b/django-celery-errorlog-0.1.1.tar.gz" } ] }