{ "info": { "author": "4teamwork AG", "author_email": "mailto:info@4teamwork.ch", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Plone", "Framework :: Plone :: 4.3", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "ftw.structlog\n=============\n\nThis package implements **structured request logging in Plone**.\n\nIt does so by writing logfiles (one per instance) that contain one JSON entry\nper line for every request. That JSON entry contains all the information the\nZ2 log provides, and more, in structured key/value pairs.\n\n\nInstallation\n------------\n\n- Install ``ftw.structlog`` by adding it to the list of eggs in your buildout.\n Then run buildout and restart your instance:\n\n.. code:: ini\n\n [instance]\n eggs +=\n ftw.structlog\n\n- Alternatively, add it as a dependency to your package's ``setup.py``.\n\n\nLogged Information\n------------------\n\nExample entry:\n\n.. code:: json\n\n {\n \"bytes\": 6875,\n \"cient_ip\": \"127.0.0.1\",\n \"duration\": 0.30268411636353,\n \"host\": \"127.0.0.1\",\n \"method\": \"GET\",\n \"referer\": \"http:\\/\\/localhost:8080\\/plone\",\n \"site\": \"plone\",\n \"status\": 200,\n \"timestamp\": \"2017-07-29T12:30:58.000750+02:00\",\n \"url\": \"http:\\/\\/localhost:8080\\/plone\\/my-page\",\n \"user\": \"john.doe\",\n \"user_agent\": \"Mozilla\\/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/60.0.3112.113 Safari\\/537.36\"\n }\n\n\nThe logged JSON entry contains the following data:\n\n+------------+---------------------------------------------------------------+\n| key | value |\n+============+===============================================================+\n| bytes | Size of response body in bytes (``Content-Length``) |\n+------------+---------------------------------------------------------------+\n| client_ip | Host where the request originated from (respecting |\n| | X-Forwarded-For) |\n+------------+---------------------------------------------------------------+\n| duration | Time spent in ZPublisher to handle request (time between |\n| | ``IPubStart`` and ``IPubSuccess`` / ``IPubFailure`` ) |\n+------------+---------------------------------------------------------------+\n| host | Deprecated. You should use ``client_ip`` instead. |\n+------------+---------------------------------------------------------------+\n| method | HTTP request method |\n+------------+---------------------------------------------------------------+\n| referer | Referer |\n+------------+---------------------------------------------------------------+\n| site | Plone site ID |\n+------------+---------------------------------------------------------------+\n| status | HTTP response status |\n+------------+---------------------------------------------------------------+\n| timestamp | Time when request was received (non-naive local time in ISO |\n| | 8601, in the server's local timezone as determined by |\n| | ``tzlocal``) |\n+------------+---------------------------------------------------------------+\n| url | URL of the request (including query string if present) |\n+------------+---------------------------------------------------------------+\n| user | Username of the authenticated user, ``\"Anonymous\"`` otherwise |\n+------------+---------------------------------------------------------------+\n| user_agent | User-Agent |\n+------------+---------------------------------------------------------------+\n\n\nLogfile Location\n----------------\n\nOne logfile per Zope2 instance will be created, and its location and name\nwill be derived from the instance's eventlog path. If the instance's eventlog\npath is ``var/log/instance2.log``, the JSON logfile's path will be\n``var/log/instance2-json.log``.\n\n**Note**: Because ``ftw.structlog`` derives its logfile name from the\neventlog path, an eventlog *must* be configured in ``zope.conf``, otherwise\n``ftw.structlog`` will not log any requests and complain noisily through\nthe root logger.\n\nWhen running tests in other projects, these errors can be muted by setting the\nenvironment variable ``FTW_STRUCTLOG_MUTE_SETUP_ERRORS=true``.\n\nLinks\n-----\n\n- Github: https://github.com/4teamwork/ftw.structlog\n- Issues: https://github.com/4teamwork/ftw.structlog/issues\n- Pypi: http://pypi.python.org/pypi/ftw.structlog\n- Continuous integration: https://jenkins.4teamwork.ch/search?q=ftw.structlog\n\n\nCopyright\n---------\n\nThis package is copyright by `4teamwork `_.\n\n``ftw.structlog`` is licensed under GNU General Public License, version 2.\n\nChangelog\n=========\n\n\n1.1.0 (2019-01-11)\n------------------\n\n- DEPRECATED: The ``host`` field is deprecated. Instead, the newly introduced\n ``client_ip`` field should be used to get the client's IP address.\n [lgraf]\n\n- Always log missing referer as empty string instead of ``null``.\n [lgraf]\n\n\n1.0.1 (2017-09-03)\n------------------\n\n- Fail gracefully if eventlog config can't be found in order to derive\n log location from it. Instead of preventing instance startup, log a\n noticeable error message using the root logger.\n [lgraf]\n\n\n1.0.0 (2017-09-03)\n------------------\n\n- Initial implementation\n [lgraf]", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/4teamwork/ftw.structlog", "keywords": "structured logging plone", "license": "GPL2", "maintainer": "", "maintainer_email": "", "name": "ftw.structlog", "package_url": "https://pypi.org/project/ftw.structlog/", "platform": "", "project_url": "https://pypi.org/project/ftw.structlog/", "project_urls": { "Homepage": "https://github.com/4teamwork/ftw.structlog" }, "release_url": "https://pypi.org/project/ftw.structlog/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Structured logging for Plone", "version": "1.1.0" }, "last_serial": 5823455, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "714e2dedb1e7a9c9919f00ee06168c54", "sha256": "3501ed4cd18881cf76b449996a3b4be69a2ff8c958a0628befe19b88612565b4" }, "downloads": -1, "filename": "ftw.structlog-1.0.0.tar.gz", "has_sig": false, "md5_digest": "714e2dedb1e7a9c9919f00ee06168c54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16639, "upload_time": "2017-09-03T20:15:22", "url": "https://files.pythonhosted.org/packages/b4/e8/a9e1e643452dc323946deff42d919f87ff4cf38762387032c8c10e5d1a93/ftw.structlog-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f7ffd6a4034fbd57830b1d505871faac", "sha256": "09806e3b08e428ce27d92d36d25ea50b37e92e684a6c2e0fa51b5f4f7c5ce330" }, "downloads": -1, "filename": "ftw.structlog-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f7ffd6a4034fbd57830b1d505871faac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16978, "upload_time": "2017-09-03T21:17:57", "url": "https://files.pythonhosted.org/packages/6c/85/e628a7326cad820291a236ec7e8a42dd0a917db5c2aefe1c74f56b0439ec/ftw.structlog-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "f5d5e0a44674d04ef5106fcb039de0aa", "sha256": "48a83fd30179599ab10bfbd46854a8018c9404cf3a1601399e2270a1b214f16b" }, "downloads": -1, "filename": "ftw.structlog-1.1.0.tar.gz", "has_sig": false, "md5_digest": "f5d5e0a44674d04ef5106fcb039de0aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19822, "upload_time": "2019-01-11T10:03:08", "url": "https://files.pythonhosted.org/packages/78/13/cc4c2e0e30287dfd43ccd97a8bd1e5a9ad093c7af89a2d7bfab67dd28ec1/ftw.structlog-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f5d5e0a44674d04ef5106fcb039de0aa", "sha256": "48a83fd30179599ab10bfbd46854a8018c9404cf3a1601399e2270a1b214f16b" }, "downloads": -1, "filename": "ftw.structlog-1.1.0.tar.gz", "has_sig": false, "md5_digest": "f5d5e0a44674d04ef5106fcb039de0aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19822, "upload_time": "2019-01-11T10:03:08", "url": "https://files.pythonhosted.org/packages/78/13/cc4c2e0e30287dfd43ccd97a8bd1e5a9ad093c7af89a2d7bfab67dd28ec1/ftw.structlog-1.1.0.tar.gz" } ] }