{ "info": { "author": "Andreas Jung", "author_email": "info@zopyx.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Plone", "Framework :: Plone :: 4.3", "Framework :: Zope2", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: System :: Logging", "Topic :: System :: Monitoring" ], "description": ".. contents:: **Table of contents**\n\nIntroduction\n============\n\n``haufe.requestmonitoring`` implements a detailed request logging functionality\non top of the publication events as introduced with Zope 2.12.\n\n\nRequirements\n============\n\n* Zope 2.12.0b2 or higher\n* Currently tested on Zope 2.13.21\n\nYou can use this with older Zope releases (2.10.x) but you must also include `ZPublisherEventsBackport`__.\n\n__ http://pypi.python.org/pypi/ZPublisherEventsBackport\n\nFeatures\n========\n\nFine resolution request logging\n-------------------------------\n\nUsed as base for ``ztop`` and ``zanalyse``, i.e. helps to determine the Zope load,\ndetect long running requests and to analyse the causes of restarts.\n\n\nThe implementation in this module registers subscribers for ``IPubStart`` and\n``IPubSuccess/IPubFailure``. For each of these events, a log entry of the form::\n\n timestamp status request_time type request_id request_info\n\nis written.\n\nFields\n++++++\n\n- *timestamp* is the current time in the format ``%y%m%dT%H%M%S``.\n\n- *status* is ``0`` for ``IPubStart`` events, ``390`` for requests that will\n be retried and the result of ``IStatus`` applied to the response otherwise.\n\n- *request_time* is ``0`` for ``IPubStart`` events. Otherwise, it will be\n the request time in seconds.\n\n- *type* is ``+`` for ``IPubStart`` and ``-`` otherwise.\n\n- *request_id* is the (process) unique request id.\n\n- *request_info* is ``IInfo`` applied to the request.\n\n\nIn addition, a log entry with ``request_info == restarted`` is written when this\nlogging is activated. Apart from ``request_info`` and ``timestamp`` all other\nfields are ``0``. It indicates (obviously) that the server has been restarted.\nFollowing requests get request ids starting with ``1``.\n\nTo activate this logging, both ``timelogging.zcml`` must be activated (on by\ndefault) and a ``product-config`` section with name ``timelogging`` must be\ndefined containing the key ``filebase``. It specifies the basename of the\nlogfile; ``.`` will be appended to this base. Then, ``ITicket``,\n``IInfo`` adapters must be defined (e.g. the one from ``info``). An\n``IStatus`` adapter may be defined for response.\n\nExample::\n\n \n filebase /path/to/request-logs/instance-foo\n \n\n\nSuccess request logging\n-----------------------\n\nThis logging writes two files ``_good.`` and ``_bad.``.\nFor each request, a character is written to either the good or the bad logfile,\ndepending on whether the request was successful or unsuccessful. This means,\nthat only the file size matters for these logfiles.\n\nUsually, response codes >= 500 are considered as unsuccessful requests. You\ncan register an ``ISuccessFull`` adapter, when you need a different\nclassification.\n\nTo activate this logging, both ``successlogging.zcml`` must be activated (on by\ndefault) and a ``product-config`` section with name ``successlogging`` must be\ndefined containing the key ``filebase``. It specifies the basename of the\nlogfiles (represented as ```` above).\n\nExample::\n\n \n filebase /path/to/request-logs/successful-foo\n \n\n\nMonitoring long running requests\n--------------------------------\n\n``haufe.requestmonitoring`` allows you to monitor long-running request. The\nfollowing configuration within your ``zope.conf`` configuration file will\ninstall the DumpTracer and check after the ``period`` time passed for requests\nrunning longer than ``time``.\n\nTo activate this logging, both ``monitor.zcml`` must be activated (off by\ndefault) and the requestmonitor configuration section must be present::\n\n zope-conf-additional =\n %import haufe.requestmonitoring\n \n # default is 1m\n period 10s\n # default is 1\n verbosity 2\n \n factory haufe.requestmonitoring.DumpTraceback.factory\n # 0 --> no repetition\n repeat -1\n time 10s\n \n \n\n\nA typical dump trace looks like this (it shows you the URL and the current \nstacktrace)::\n\n\n 2009-08-11 14:29:09 INFO Zope Ready to handle requests\n 2009-08-11 14:29:09 INFO RequestMonitor started\n 2009-08-11 14:29:14 INFO RequestMonitor monitoring 1 requests\n 2009-08-11 14:29:19 INFO RequestMonitor monitoring 1 requests\n 2009-08-11 14:29:24 INFO RequestMonitor monitoring 1 requests\n 2009-08-11 14:29:24 WARNING RequestMonitor.DumpTrace Long running request\n Request 1 \"/foo\" running in thread -497947728 since 14.9961140156s\n Python call stack (innermost first)\n Module /home/junga/sandboxes/review/parts/instance/Extensions/foo.py, line 4, in foo\n Module Products.ExternalMethod.ExternalMethod, line 231, in __call__\n - __traceback_info__: ((), {}, None)\n Module ZPublisher.Publish, line 46, in call_object\n Module ZPublisher.mapply, line 88, in mapply\n Module ZPublisher.Publish, line 126, in publish\n Module ZPublisher.Publish, line 225, in publish_module_standard\n Module ZPublisher.Publish, line 424, in publish_module\n Module Products.ZopeProfiler.ZopeProfiler, line 353, in _profilePublishModule\n Module Products.ZopeProfiler.MonkeyPatcher, line 35, in __call__\n Module ZServer.PubCore.ZServerPublisher, line 28, in __init__\n\nThe log line \"*RequestMonitor monitoring X requests*\" simply says that a request\nis under monitor and sometimes you get useless noise in the log file.\n\nYou can play with the ``verbosity`` option: put the value to *0* for disable\nthe log line.\nDefault value (*1*) will display the log line every time one or more requests\nare under monitor.\nA value of *2* is more verbose, displaying also info about requests URLs.\n\nDump trace on pdb\n+++++++++++++++++\n\nTraceback dump can became quickly a nightmare if you put a Python debug line on your source code\nand then you want to test it running Zope.\n\nIn that case you can disable traceback dump when you are executing the debugger. Simply add the\n``DISABLE_HAUFE_MONITORING_ON_PDB`` environment variable::\n\n environment-vars =\n ...\n DISABLE_HAUFE_MONITORING_ON_PDB True\n\nInstallation\n------------\n\nAdd ``haufe.requestmonitoring`` to both ``eggs`` and ``zcml`` option of\nyour buildout.cfg file.\n\nAuthor\n======\n\n- original author: Dieter Maurer \n- current maintainer: Andreas Jung, info@zopyx.com\n\n\nLicense\n=======\n\n``haufe.requestmonitoring`` is published under the Zope Public License V 2.1\n(ZPL). See LICENSE.txt.\n\n\n\n\nChangelog\n=========\n\n0.5.1 (2018-04-03)\n------------------\n\n- Fix logging format.\n Refs: #9\n [mamico]\n\n\n0.5.0 (2016-09-29)\n------------------\n\n- For all logging output, use unicode and string ``format`` instead of string substitution to avoid possible encoding errors.\n Refs: #5.\n [thet]\n\n- Allow the ``monitorhandler`` define it's zLOG loglevel.\n This makes possible to define the ``ERROR`` level instead of ``WARNING`` for long running requests and get notified by a tool like Sentry, when it's configured to notice ``ERROR`` level logs.\n [thet]\n\n- Remove Logger.py, which is a simpler version of the \"Long Request Logger\" in DumpTraceback.py and isn't used nor documented.\n [thet]\n\n- Move ``docs/HISTORY.txt`` to ``CHANGES.rst``.\n [thet]\n\n- PEP8 compatibility\n\n\n0.4.0 (2013-09-20)\n------------------\n\n- Added retro-compatibility with old versions of Zope without bein forced to manually patch Zope.\n [giacomos]\n\n- You can now add a ``DISABLE_HAUFE_MONITORING_ON_PDB`` envvar to stop dumping traceback when on Python ``pdb``.\n [keul]\n\n\n0.3.0 (2012-10-16)\n------------------\n\n- Do not use deprecated ``threadframe`` dependency anymore on recent Python versions.\n [keul]\n\n- Fixed egg dependencies for Zope 2.13.\n [keul]\n\n- Added the ``verbosity`` configuration option for the logger.\n [keul]\n\n\n0.2.3 - (2009/08/11)\n--------------------\n\n- Updated documentation.\n\n\n0.2.2 - (2009/07/20)\n--------------------\n\n- Minor cleanup.\n\n- Minor documentation cleanup.\n\n\n0.2.1 - (2009/05/28)\n--------------------\n\n- Configure 'successlogging' by default.\n\n- Slightly updated documentation.\n\n\n0.2.0 - (2009/05/12)\n--------------------\n\n- Initial release.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/collective/haufe.requestmonitoring", "keywords": "zope long-running-request monitor logging", "license": "ZPL", "maintainer": "", "maintainer_email": "", "name": "haufe.requestmonitoring", "package_url": "https://pypi.org/project/haufe.requestmonitoring/", "platform": "", "project_url": "https://pypi.org/project/haufe.requestmonitoring/", "project_urls": { "Homepage": "http://github.com/collective/haufe.requestmonitoring" }, "release_url": "https://pypi.org/project/haufe.requestmonitoring/0.5.1/", "requires_dist": null, "requires_python": "", "summary": "Zope 2 request monitoring", "version": "0.5.1" }, "last_serial": 3728758, "releases": { "0.1.0": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "929904100f118860270aca14a00d781e", "sha256": "9c8b43938ef1785173e4ed58dd697ed6dfbe7a0d616273014711ab27b76a828e" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.2.0.tar.gz", "has_sig": false, "md5_digest": "929904100f118860270aca14a00d781e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11508, "upload_time": "2009-05-12T11:25:39", "url": "https://files.pythonhosted.org/packages/d6/fc/b24b156a70fec253a46efd6e3d6a4e6c898148926ed2f9f8978168cc297f/haufe.requestmonitoring-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "42c1c3c39a748af226fe3c1c53786fb4", "sha256": "58efc2e427f19881b120ef2743f3e027e20aad7cfc484993a07bd02bb31e89de" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.2.1.tar.gz", "has_sig": false, "md5_digest": "42c1c3c39a748af226fe3c1c53786fb4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11085, "upload_time": "2009-05-28T19:54:49", "url": "https://files.pythonhosted.org/packages/57/c2/320206082e512a77c8e4a8b8a99895b6795fe22bd823c2774f550a3e309f/haufe.requestmonitoring-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "93e4235783a50406fe64813d0d7d93c9", "sha256": "a5b4adb4102b4615bdfd1d934441c2193c9005232b97934a923121e2f5e20189" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.2.2.tar.gz", "has_sig": false, "md5_digest": "93e4235783a50406fe64813d0d7d93c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11184, "upload_time": "2009-07-20T15:30:45", "url": "https://files.pythonhosted.org/packages/ad/8a/413b8fed63f5e8bdcbb83ec6481468aefadd944e713a31fc195c6937ac90/haufe.requestmonitoring-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "17ee9240cdcec00a11ea148aee9ad6b7", "sha256": "08990053c5352a6741aadf97544000b833bc32fb1c162f7ff43c2db5d36e3a28" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.2.3.tar.gz", "has_sig": false, "md5_digest": "17ee9240cdcec00a11ea148aee9ad6b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13456, "upload_time": "2009-08-11T14:31:44", "url": "https://files.pythonhosted.org/packages/ac/07/1ab3f19b19c6e449e903f5aaab3dd1cca24ee030e10320a8c27787173185/haufe.requestmonitoring-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "4ef92a4255bdfbba414ba36985f5edf3", "sha256": "f092548b31851b486e858ddbe258fce04197b777d0193c0b5ae3374ca3bfdf65" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.3.0.zip", "has_sig": false, "md5_digest": "4ef92a4255bdfbba414ba36985f5edf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25238, "upload_time": "2012-10-16T12:56:46", "url": "https://files.pythonhosted.org/packages/9f/f4/0ff09a48ee2fa0c14fdde4564dfae8fa4972a85e4a232513be5fbaff190e/haufe.requestmonitoring-0.3.0.zip" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "187996f1e0ab99d7c5692bcbe1cff8ef", "sha256": "52f9c394ac0acca519e8b6e2d4e82a3da98d005b8915248d5d320294ab0e4c0b" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.4.0.zip", "has_sig": false, "md5_digest": "187996f1e0ab99d7c5692bcbe1cff8ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26852, "upload_time": "2013-09-20T15:53:36", "url": "https://files.pythonhosted.org/packages/13/c5/b1d708f8d96a7d54d2e0f9812cc5a32bd90a772d9b4a98e4217df0e7abb7/haufe.requestmonitoring-0.4.0.zip" } ], "0.4.0.1": [ { "comment_text": "", "digests": { "md5": "fbd515807d871a941bd54b2034b23059", "sha256": "c65017e5e94b3bd34d1ab04de66e39b17532d6ae799ac949db557703ca580f74" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.4.0.1.zip", "has_sig": false, "md5_digest": "fbd515807d871a941bd54b2034b23059", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28289, "upload_time": "2015-01-13T07:33:44", "url": "https://files.pythonhosted.org/packages/a4/7e/2577d39999175bde6c2a4ab9444b66e9a227ca3a86c7e126c7e5fd027329/haufe.requestmonitoring-0.4.0.1.zip" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "61be36a1e9ad1e357d6b9077b957a699", "sha256": "fed0b050033ea39ea680ed535235e50c50be3aa759323fa689e09c93445790f5" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.5.0.tar.gz", "has_sig": false, "md5_digest": "61be36a1e9ad1e357d6b9077b957a699", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13971, "upload_time": "2016-09-29T12:54:15", "url": "https://files.pythonhosted.org/packages/c7/ce/e649fa6d1f414784bdd4899055224c54fc4d2a4352a9bad5fa1a42cd99a3/haufe.requestmonitoring-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "b08c5e89dc1287e21b0f3c736f06c864", "sha256": "622a6daf60348e2f825c0b700daec2254c4ab56fb6315864c6a324e9ef2557c4" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.5.1.tar.gz", "has_sig": false, "md5_digest": "b08c5e89dc1287e21b0f3c736f06c864", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15771, "upload_time": "2018-04-03T08:25:45", "url": "https://files.pythonhosted.org/packages/e0/05/472a704f6ef35b473f7a10187f472f5a3cc6c12f18b22c3de71dc3e263c4/haufe.requestmonitoring-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b08c5e89dc1287e21b0f3c736f06c864", "sha256": "622a6daf60348e2f825c0b700daec2254c4ab56fb6315864c6a324e9ef2557c4" }, "downloads": -1, "filename": "haufe.requestmonitoring-0.5.1.tar.gz", "has_sig": false, "md5_digest": "b08c5e89dc1287e21b0f3c736f06c864", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15771, "upload_time": "2018-04-03T08:25:45", "url": "https://files.pythonhosted.org/packages/e0/05/472a704f6ef35b473f7a10187f472f5a3cc6c12f18b22c3de71dc3e263c4/haufe.requestmonitoring-0.5.1.tar.gz" } ] }