{"id":13480786,"url":"https://github.com/puentesarrin/mongodb-log","last_synced_at":"2025-03-27T11:30:54.136Z","repository":{"id":6134010,"uuid":"7362440","full_name":"puentesarrin/mongodb-log","owner":"puentesarrin","description":"MongoDB Python logging handler, Centralized logging made simple using MongoDB.","archived":false,"fork":true,"pushed_at":"2019-06-08T02:23:47.000Z","size":138,"stargazers_count":135,"open_issues_count":2,"forks_count":23,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-18T17:31:21.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.mongodb.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"andreisavu/mongodb-log","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puentesarrin.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-29T03:16:02.000Z","updated_at":"2024-07-07T02:44:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/puentesarrin/mongodb-log","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puentesarrin%2Fmongodb-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puentesarrin%2Fmongodb-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puentesarrin%2Fmongodb-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puentesarrin%2Fmongodb-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puentesarrin","download_url":"https://codeload.github.com/puentesarrin/mongodb-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245835942,"owners_count":20680296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:44.994Z","updated_at":"2025-03-27T11:30:53.808Z","avatar_url":"https://github.com/puentesarrin.png","language":"Python","funding_links":[],"categories":["Python","Libraries"],"sub_categories":["Python"],"readme":"MongoLog: Centralized logging made simple using MongoDB\n=======================================================\n\n.. image:: https://travis-ci.org/puentesarrin/mongodb-log.png\n    :target: https://travis-ci.org/puentesarrin/mongodb-log\n    :alt: Travis CI status\n\n.. image:: https://pypip.in/v/mongolog/badge.png\n    :target: https://pypi.python.org/pypi/mongolog\n    :alt: Latest PyPI version\n\n.. image:: https://pypip.in/d/mongolog/badge.png\n    :target: https://pypi.python.org/pypi/mongolog\n    :alt: Number of PyPI downloads\n\n:Info: MongoDB python logging handler. Python centralized logging made easy.\n:Author: `Andrei Savu`_\n:Maintainer: `Jorge Puente Sarrín`_\n\nSetup\n-----\n\nBefore using this handler for logging you will need to create a capped\ncollection on the MongoDB server.\n\nYou can do this using the following commands in the MongoDB shell::\n\n   \u003e use mongolog\n   \u003e db.createCollection('log', {capped:true, size:100000})\n\n... and you are ready. Running ``stats()`` function on ``log`` collection\nshould show something like this::\n\n   \u003e db.log.stats()\n   {\n           \"ns\" : \"mongolog.log\",\n           \"count\" : 0,\n           \"size\" : 0,\n           \"storageSize\" : 102400,\n           \"numExtents\" : 1,\n           \"nindexes\" : 1,\n           \"lastExtentSize\" : 102400,\n           \"paddingFactor\" : 1,\n           \"systemFlags\" : 1,\n           \"userFlags\" : 0,\n           \"totalIndexSize\" : 8176,\n           \"indexSizes\" : {\n                   \"_id_\" : 8176\n           },\n           \"capped\" : true,\n           \"max\" : 2147483647,\n           \"ok\" : 1\n   }\n\n\nUsage\n-----\n\n\u003e\u003e\u003e import logging\n\u003e\u003e\u003e from mongolog.handlers import MongoHandler\n\u003e\u003e\u003e\n\u003e\u003e\u003e log = logging.getLogger('demo')\n\u003e\u003e\u003e log.setLevel(logging.DEBUG)\n\u003e\u003e\u003e log.addHandler(MongoHandler.to(db='mongolog', collection='log'))\n\u003e\u003e\u003e\n\u003e\u003e\u003e log.debug('Some message')\n\n\nCheck the samples folder for more details.\n\n\nWhy centralized logging?\n------------------------\n\n* Easy troubleshouting:\n    * Having the answers to why? quickly and accurately.\n    * For troubleshouting while the system is down.\n    * Removed risk of loss of log information.\n* Resource tracking.\n* Security.\n\n\nWhat is MongoDB?\n----------------\n\n\"MongoDB is a high-performance, open source, schema-free document-oriented\ndatabase.\"\n\nIt can eficiently store arbitrary JSON objects. You can read more at\n`MongoDB website`_.\n\n\nWhy MongoDB is great for logging?\n---------------------------------\n\n* MongoDB inserts can be done asynchronously.\n* Old log data automatically LRU's out thanks to capped collections.\n* It's fast enough for the problem.\n* Document-oriented / JSON is a great format for log information.\n\nRead more about this subject on the `MongoDB blog`_.\n\n\nHave fun!\n\n\n.. _Andrei Savu: https://github.com/andreisavu\n.. _Jorge Puente Sarrín: https://github.com/puentesarrin\n.. _MongoDB website: http://www.mongodb.org\n.. _MongoDB blog: http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuentesarrin%2Fmongodb-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuentesarrin%2Fmongodb-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuentesarrin%2Fmongodb-log/lists"}