{ "info": { "author": "Vladim\u00edr Gorej", "author_email": "vladimir.gorej@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: System :: Logging", "Topic :: System :: Monitoring", "Topic :: Utilities" ], "description": "log4mongo-python\n================\nlog4mongo-python is mongo database handler for python logging, part of log4mongo.org project.\nlog4mongo-python is using pymongo driver - http://github.com/mongodb/mongo-python-driver\n\n\nRequirements\n------------\n\n- python 2.7+\n- pymongo 2.8+\n- mongo database\n\nFor more information see *debian_requirements.txt* and *requirements.txt* files.\n\nConfiguration\n-------------\n\nExample handler python configuration:\n\n.. code-block:: python\n\n import logging\n from log4mongo.handlers import MongoHandler\n\n logger = logging.getLogger('test')\n logger.addHandler(MongoHandler(host='localhost'))\n logger.warning('test')\n\n\nContextual information\n----------------------\n\nIt is possible to decorate you document with contextual information. There are tow approaches.\n\n**1.) approach**\n\n.. code-block:: python\n\n import logging\n from log4mongo.handlers import MongoHandler\n\n handler = MongoHandler(host='localhost')\n logger = logging.getLogger('test')\n logger.addHandler(handler)\n logging.LoggerAdapter(logger, {'ip': '127.0.0.1'}).info('test')\n\n**2.) approach**\n\n.. code-block:: python\n\n import logging\n from log4mongo.handlers import MongoHandler\n\n handler = MongoHandler(host='localhost')\n logger = logging.getLogger('test')\n logger.addHandler(handler)\n logger.info('test', extra={'ip': '127.0.0.1'})\n\n\nAs you can see, second approach is more straightforward and there is no need to use LoggerAdapter.\n\n\nCapped collections\n------------------\n\nCapped collections are fixed-size collections that support high-throughput operations that insert, retrieve,\nand delete documents based on insertion order. Capped collections work in a way similar\nto circular buffers: once a collection fills its allocated space, it makes room for new documents\nby overwriting the oldest documents in the collection.\n\nBefore switching to capped collections, read this document please: http://docs.mongodb.org/manual/core/capped-collections/\n\nThis behaviour is disabled by default. You can enable this behaviour in constructor with *capped=True*:\n\n.. code-block:: python\n\n import logging\n from log4mongo.handlers import MongoHandler\n\n handler = MongoHandler(host='localhost', capped=True)\n\n\nBuffered handler\n----------------\n\n``BufferedMongoHandler`` is a subclass of ``MongoHandler`` allowing to buffer log messages\nand write them all at once to the database. The goal is to avoid too many writes to the database, thus avoiding\ntoo frequent write-locks.\nLog message buffer flush happens when the buffer is full, when a critical log message is emitted, and also periodically.\nAn early buffer flush can happen when a critical message is emitted.\nAnd in order to avoid messages to stay indefinitively in the buffer queue before appearing in database, a periodical\nflush happens every X seconds.\n\nThis periodical flush can also be deactivated with ``buffer_periodical_flush_timing=False``, thus avoiding\nthe timer thread to be created.\n\nBuffer size is configurable, as well as the log level for early flush (default is ``logging.CRITICAL``):\n\n.. code-block:: python\n\n import logging\n from log4mongo.handlers import BufferedMongoHandler\n\n handler = BufferedMongoHandler(host='localhost', # All MongoHandler parameters are valid\n capped=True,\n buffer_size=100, # buffer size.\n buffer_periodical_flush_timing=10.0, # periodical flush every 10 seconds\n buffer_early_flush_level=logging.CRITICAL) # early flush level\n\n logger = logging.getLogger().addHandler(handler)\n\n\nTest\n-----\n\n** Tested on evnironment **\n\n- Ubuntu 14.04\n- python >2.7.4\n- pymongo >2.8.3\n- mongod - db version v3.0.2\n- pytest\n\n**Running tests**\n\nBefore you run the test you must start mongo database. You will do so by this command:\n\n.. code-block::\n\n $ mongod --dbpath /tmp/\n\n\nTo run the test run command:\n\n.. code-block::\n\n $ python setup.py test\n\n\nSee vagrant file to quickly setup the test environment.\n\nOriginal Author\n---------------\n\n| char0n (Vladimir Gorej)\n| email: vladimir.gorej@gmail.com\n| web: https://www.linkedin.com/in/vladimirgorej/\n\nCurrent Maitainer\n-----------------\n| Oz Nahum Tiram\n| email: nahumoz@gmail.com\n| web: oz123.github.io\n\nReferences\n----------\n- http://www.mongodb.org/\n- http://docs.python.org/library/logging.html\n- http://github.com/mongodb/mongo-python-driver\n- http://log4mongo.org", "description_content_type": null, "docs_url": null, "download_url": "http://github.com/log4mongo/log4mongo-python/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://log4mongo.org/display/PUB/Log4mongo+for+Python", "keywords": "mongodb mongo logging handler", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "log4mongo", "package_url": "https://pypi.org/project/log4mongo/", "platform": "any", "project_url": "https://pypi.org/project/log4mongo/", "project_urls": { "Download": "http://github.com/log4mongo/log4mongo-python/tarball/master", "Homepage": "http://log4mongo.org/display/PUB/Log4mongo+for+Python" }, "release_url": "https://pypi.org/project/log4mongo/1.6.2/", "requires_dist": null, "requires_python": "", "summary": "mongo database handler for python logging", "version": "1.6.2" }, "last_serial": 3259819, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "3cd6af52b9e1beaab788d8dd6bf75866", "sha256": "543886df166d9d5343304f26be03974bc93636e73d599f7b974d83b719778ef3" }, "downloads": -1, "filename": "log4mongo-1.0.tar.gz", "has_sig": false, "md5_digest": "3cd6af52b9e1beaab788d8dd6bf75866", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3607, "upload_time": "2011-07-05T14:22:32", "url": "https://files.pythonhosted.org/packages/11/a3/209c8835718f93b97e28e4879fd978907d2e0bb6d3c0b84550337a003ad4/log4mongo-1.0.tar.gz" } ], "1.0rc1": [ { "comment_text": "", "digests": { "md5": "c846d7593e1950e7e2a8097f687b6bcc", "sha256": "b30803d19940eb839e636e96c378caf4893d03522e16d14f7004d28d3dd9442f" }, "downloads": -1, "filename": "log4mongo-1.0rc1.tar.gz", "has_sig": false, "md5_digest": "c846d7593e1950e7e2a8097f687b6bcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3450, "upload_time": "2010-11-04T21:37:30", "url": "https://files.pythonhosted.org/packages/a6/81/fce9a7e4451205892143504901bb99818120bc79ebc9fb399fa04d3e0beb/log4mongo-1.0rc1.tar.gz" } ], "1.0rc2": [ { "comment_text": "", "digests": { "md5": "27f2eef6fa2168784b6b05aacf21cdac", "sha256": "d9d1724e744fb85172fed89bd067529e3b3d8c45a04a27756bd7f3051662f2c6" }, "downloads": -1, "filename": "log4mongo-1.0rc2.tar.gz", "has_sig": false, "md5_digest": "27f2eef6fa2168784b6b05aacf21cdac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3544, "upload_time": "2010-11-27T23:20:45", "url": "https://files.pythonhosted.org/packages/64/bd/3d611767e8513c6f1de7a4fd890572e262ea2d78b7ea28b77dc96d79a53c/log4mongo-1.0rc2.tar.gz" } ], "1.1b1": [ { "comment_text": "", "digests": { "md5": "710fedec2b74eaacf2bec5d9b6db19d7", "sha256": "407b30bd5bddfcc4e7dd57bb0eb175d6350abf1ff67c63777fa7779770e2c616" }, "downloads": -1, "filename": "log4mongo-1.1b1.tar.gz", "has_sig": false, "md5_digest": "710fedec2b74eaacf2bec5d9b6db19d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5454, "upload_time": "2011-12-13T21:52:13", "url": "https://files.pythonhosted.org/packages/db/57/b95d4f4ac95c8a9f099480c99dcf1223674e33c1c8eca2eb55e77c9d40fa/log4mongo-1.1b1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "b616f732a3500d52a84b785bdd592b15", "sha256": "1e74564cbe091da96aa88da83c55f27d1a79d02bba67b80e1c1b1c9ceb474417" }, "downloads": -1, "filename": "log4mongo-1.2.tar.gz", "has_sig": false, "md5_digest": "b616f732a3500d52a84b785bdd592b15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6172, "upload_time": "2012-12-24T12:45:55", "url": "https://files.pythonhosted.org/packages/ed/d4/943fdb3d6d98db55215f2b04040a0c1ae5f6c34d469d0d356d9d7253f68f/log4mongo-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "e91422d68f880f5bc91abf3218bdab81", "sha256": "0e96936bc7ba262ea837835bb3f9753652ae2bf3020defead439edffe706ac5b" }, "downloads": -1, "filename": "log4mongo-1.2.1.tar.gz", "has_sig": false, "md5_digest": "e91422d68f880f5bc91abf3218bdab81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6236, "upload_time": "2013-01-10T14:03:20", "url": "https://files.pythonhosted.org/packages/2a/65/0b8132b5fe66b40ba21e4298d082718d48952576c6aaaed05bd12691348a/log4mongo-1.2.1.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "b1ba156432a6423b53f713c33bec77ed", "sha256": "df703ee0efc685774d51b43e800b71a1c3f8f864b15ee520053218901485eaac" }, "downloads": -1, "filename": "log4mongo-1.3.0.tar.gz", "has_sig": false, "md5_digest": "b1ba156432a6423b53f713c33bec77ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6323, "upload_time": "2013-10-28T11:17:27", "url": "https://files.pythonhosted.org/packages/7b/67/cbc6b19f4997bbacbc1fd8e3427c024953dc1c279f11ce6379c81051ed0d/log4mongo-1.3.0.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "6c7581890ec10b2e9f6af1328c3ff758", "sha256": "4a0d5ba80cb47563c4157190ee9b4cf2af25f4194f5c4d5cd510a7ac461ff30a" }, "downloads": -1, "filename": "log4mongo-1.4.1.tar.gz", "has_sig": false, "md5_digest": "6c7581890ec10b2e9f6af1328c3ff758", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6647, "upload_time": "2015-04-23T13:05:23", "url": "https://files.pythonhosted.org/packages/e8/54/7bfab0e9c191282af327f6d55a5c8f0fc6d8a68d75eec940575dc62da57d/log4mongo-1.4.1.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "faab295cfd33b302568ba6ea4066359f", "sha256": "d99c012420ed22111d5e3cf42e87c0626748a44c86810c966ab11c92376adb0a" }, "downloads": -1, "filename": "log4mongo-1.4.2.tar.gz", "has_sig": false, "md5_digest": "faab295cfd33b302568ba6ea4066359f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6652, "upload_time": "2015-04-24T14:12:53", "url": "https://files.pythonhosted.org/packages/78/cf/10654613e104ebef3bfc4c2a9993525e408b741229d1a856b74769826403/log4mongo-1.4.2.tar.gz" } ], "1.4.3": [ { "comment_text": "", "digests": { "md5": "2cd5eefd1f37f8debf4ce3f2ca4ac9c1", "sha256": "bcd04524fc75da34b4e22afb8038d9accaf8a7deaf2cfc13210245e6935421a9" }, "downloads": -1, "filename": "log4mongo-1.4.3.tar.gz", "has_sig": false, "md5_digest": "2cd5eefd1f37f8debf4ce3f2ca4ac9c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6905, "upload_time": "2015-04-30T14:14:57", "url": "https://files.pythonhosted.org/packages/8d/a3/ee66f0608391886744ee1e3c80a77add49017f6b60ca5708867e4733ec97/log4mongo-1.4.3.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "8bf0ad2618dace6b7a78bddcfca901ac", "sha256": "d9937056e41d752ef9f55389239674a4a14bc1c7e7c574a2ed193efba953c584" }, "downloads": -1, "filename": "log4mongo-1.5.0.tar.gz", "has_sig": false, "md5_digest": "8bf0ad2618dace6b7a78bddcfca901ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6946, "upload_time": "2016-08-16T18:33:25", "url": "https://files.pythonhosted.org/packages/54/11/7d919753c1c8a89bb8cf7eb869ae3d4c9b134423befdac581adeec035cd5/log4mongo-1.5.0.tar.gz" } ], "1.6.0": [ { "comment_text": "", "digests": { "md5": "3429a02b5f4dc9eebf8bf9778a469ded", "sha256": "9733805f13f8dbae1354f86042aa54f83451949d9554ea3b4efdc8e6243728df" }, "downloads": -1, "filename": "log4mongo-1.6.0.tar.gz", "has_sig": false, "md5_digest": "3429a02b5f4dc9eebf8bf9778a469ded", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9541, "upload_time": "2016-10-24T12:47:08", "url": "https://files.pythonhosted.org/packages/66/24/e92f0c4f3e2e18fd7b3a3673c09fc421b94b3c3ae539f3fd4c3c2f4373bc/log4mongo-1.6.0.tar.gz" } ], "1.6.1": [ { "comment_text": "", "digests": { "md5": "2aab92d9eec0fba6a0a0c72f2ae535d5", "sha256": "305f15c3ec0338f8b574e08250540fb0349eef0987a3fbf44af049634f439cee" }, "downloads": -1, "filename": "log4mongo-1.6.1.tar.gz", "has_sig": false, "md5_digest": "2aab92d9eec0fba6a0a0c72f2ae535d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14708, "upload_time": "2017-07-08T07:20:33", "url": "https://files.pythonhosted.org/packages/a1/2c/f49b3793d19815a65c765a4f8e4121598cd81967ffb10514762ad5a42794/log4mongo-1.6.1.tar.gz" } ], "1.6.2": [ { "comment_text": "", "digests": { "md5": "b38b2cb1317ad5b99c8cf4b55738e404", "sha256": "885f466649f86e045d0d957ba08d90c6f35f0774edd26298f72cceb63cfbb2bb" }, "downloads": -1, "filename": "log4mongo-1.6.2.tar.gz", "has_sig": false, "md5_digest": "b38b2cb1317ad5b99c8cf4b55738e404", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9454, "upload_time": "2017-10-18T12:57:56", "url": "https://files.pythonhosted.org/packages/e8/78/4627638094644ffc33f6031e033c4488b15f10223bab009359dc7b3be96c/log4mongo-1.6.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b38b2cb1317ad5b99c8cf4b55738e404", "sha256": "885f466649f86e045d0d957ba08d90c6f35f0774edd26298f72cceb63cfbb2bb" }, "downloads": -1, "filename": "log4mongo-1.6.2.tar.gz", "has_sig": false, "md5_digest": "b38b2cb1317ad5b99c8cf4b55738e404", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9454, "upload_time": "2017-10-18T12:57:56", "url": "https://files.pythonhosted.org/packages/e8/78/4627638094644ffc33f6031e033c4488b15f10223bab009359dc7b3be96c/log4mongo-1.6.2.tar.gz" } ] }