{ "info": { "author": "Novapost", "author_email": "bruno.bord@novapost.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", "Topic :: System :: Logging" ], "description": "Django simple SQL log\n=====================\n\n.. image:: https://travis-ci.org/novafloss/django-sql-log.svg?branch=master\n\n\nGoal: provide a middleware that inserts start/stop annotations that\nwould land on the SQL logs.\n\nLike this:\n\n::\n\n 2014-12-08 09:33:58 CET LOG: duration: 0.174 ms statement: BEGIN\n 2014-12-08 09:33:58 CET LOG: duration: 0.502 ms statement: SET TIME ZONE 'UTC'\n 2014-12-08 09:33:58 CET LOG: duration: 0.053 ms statement: COMMIT\n 2014-12-08 09:33:58 CET LOG: duration: 0.228 ms statement: SHOW default_transaction_isolation\n 2014-12-08 09:33:58 CET LOG: duration: 0.043 ms statement: BEGIN\n 2014-12-08 09:33:58 CET LOG: duration: 0.354 ms statement: SELECT 'django_sql_log_demo.views.Index_START'\n 2014-12-08 09:33:58 CET LOG: duration: 1.221 ms statement: SELECT \"dummy_article\".\"id\", \"dummy_article\".\"title\", \"dummy_article\".\"body\" FROM \"dummy_article\"\n 2014-12-08 09:33:58 CET LOG: duration: 0.118 ms statement: SELECT 'django_sql_log_demo.views.Index_STOP'\n 2014-12-08 09:33:58 CET LOG: duration: 0.067 ms statement: ROLLBACK\n 2014-12-08 09:33:59 CET LOG: duration: 0.179 ms statement: BEGIN\n 2014-12-08 09:33:59 CET LOG: duration: 0.513 ms statement: SET TIME ZONE 'UTC'\n 2014-12-08 09:33:59 CET LOG: duration: 0.054 ms statement: COMMIT\n 2014-12-08 09:33:59 CET LOG: duration: 0.231 ms statement: SHOW default_transaction_isolation\n 2014-12-08 09:34:00 CET LOG: duration: 117.999 ms statement: DROP DATABASE \"test_hello_world\"\n\nThe available middleware has been tested only with Postgresql databases,\nbut it should work with other SQL-based RDBMs.\n\nUsage\n-----\n\nAdd this package to your requirements, and install it the usual way. You\ndon't have to add the application to the ``INSTALLED_APPS``, there's no\nmodel to sync.\n\nAdd the middleware like this:\n\n.. code:: python\n\n MIDDLEWARE_CLASSES = (\n 'django_sql_log.middleware.SQLLoggingMiddleware',\n # ...\n )\n\nAlthough the order of the middlewares is not crucial, it is better to\nmake sure that the middleware is near the first place in the list.\n\nLog format string\n~~~~~~~~~~~~~~~~~\n\nBy default, the log format string is:\n\n::\n\n {full_name}_{phase}\n\nIn the demo site, this would result in:\n\n::\n\n django_sql_log_demo.views.Index_START\n\nfor the START event in the log.\n\nYou can customize this format by adding the ``DJANGO_SQL_LOG_FORMAT`` to\nyour settings. Available format variables are (with correspondance in\nthe demo tests):\n\n- ``module_name``: ``django_sql_log_demo.views``,\n- ``func_name``: ``Index``,\n- ``full_name``: ``django_sql_log_demo.views.Index``,\n- ``phase``: START or STOP,\n\nHacking\n-------\n\nIf you want to run the test-suite, have a look at the ``settings_pg.py`` file\nin your ``demo/django_sql_log_demo`` directory.\n\nIt carries the basic database settings you'll need to run tox tests and\neventually store demo data. Hopefully, by simply creating a\n``settings_pg_local.py`` file, you can override the default credentials to fit\nyour Postgresql server specifics.\n\nPlease bear in mind that the database you'll have to connect to **must exist**\non this server, and that your PG user should be able to *create* and *delete*\ndatabases.\n\nWith ``tox`` installed, simply run the command ``tox``. This should run\nthe tests for Sqlite and postgresql environments, if ready.\n\nLogging in Postgresql\n~~~~~~~~~~~~~~~~~~~~~\n\nFor you information, logs are not activated by default in postgresql settings.\nTo make sure your log file will display the START/STOP events, go edit\nyour ``postgresql.conf`` file and set this variable::\n\n log_min_duration_statement = 0\n\nFor other database systems, please refer to the official documentation.\n\n\nThis software is published under the terms of the MIT License. Please\nsee the ``LICENSE`` file for more information.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/novafloss/django-sql-log", "keywords": "django SQL log postgresql", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-sql-log", "package_url": "https://pypi.org/project/django-sql-log/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sql-log/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/novafloss/django-sql-log" }, "release_url": "https://pypi.org/project/django-sql-log/1.2.1/", "requires_dist": null, "requires_python": null, "summary": "Write Start/Stop events in your SQL logs.", "version": "1.2.1" }, "last_serial": 2890246, "releases": { "1.1.0": [ { "comment_text": "built for Linux-3.13.0-45-generic-x86_64-with-glibc2.4", "digests": { "md5": "2ba0ce5b1fd45db88400b0924eda98d2", "sha256": "f8c3b3160f7494f334ca56da262ba688ea4ee9fd04e3e0d2b1d12842a699122d" }, "downloads": -1, "filename": "django-sql-log-1.1.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "2ba0ce5b1fd45db88400b0924eda98d2", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3843, "upload_time": "2015-02-10T17:04:02", "url": "https://files.pythonhosted.org/packages/9e/bf/5becfbe235af85f1866a67d60bee07c11ccb22dbefbda576e19f428eed4e/django-sql-log-1.1.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "c9497c65e5ff509d652b22ce975715f1", "sha256": "72db69264002cdebeda6a6ceadfd4c7c07f73352c34fb019a10a08db2675a830" }, "downloads": -1, "filename": "django-sql-log-1.1.0.tar.gz", "has_sig": false, "md5_digest": "c9497c65e5ff509d652b22ce975715f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4430, "upload_time": "2015-02-10T17:03:59", "url": "https://files.pythonhosted.org/packages/41/d1/cbf2838d6c4f419b9bbd55cb0ec8b0177fe358afb0bcaa8eb24d19d89703/django-sql-log-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "built for Linux-3.13.0-53-generic-x86_64-with-glibc2.4", "digests": { "md5": "9f589a3cf8d9591f2a7607b275b5f9b6", "sha256": "f8c083c0203df472096e38ddd1821d3d922d40ca0ace29ddc2cefa7374852b59" }, "downloads": -1, "filename": "django-sql-log-1.2.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "9f589a3cf8d9591f2a7607b275b5f9b6", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3995, "upload_time": "2015-06-09T09:03:43", "url": "https://files.pythonhosted.org/packages/66/b2/5cbc3dd4864125e1cf5e1b605aae83670e00fb49cec430b0498cc3d4b252/django-sql-log-1.2.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "6bbe628bfe9f6a6dc85260a55faace91", "sha256": "1cdf91f8d984ba7ed2c16a668ef9682916294af34c11439850b0ab99eddd0005" }, "downloads": -1, "filename": "django_sql_log-1.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "6bbe628bfe9f6a6dc85260a55faace91", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6158, "upload_time": "2015-06-09T09:03:47", "url": "https://files.pythonhosted.org/packages/45/36/c2b6daf1e2f794349a609e382a569b11a6e5b9474bf330b4e6e43fb0896a/django_sql_log-1.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9138d60d7214ee2ccd3e35ceee4ab019", "sha256": "6fbb99b01c9704afafd1c93e687763f2c5455931bef1e0c4e97a68fad1b73196" }, "downloads": -1, "filename": "django-sql-log-1.2.0.tar.gz", "has_sig": false, "md5_digest": "9138d60d7214ee2ccd3e35ceee4ab019", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4484, "upload_time": "2015-06-09T09:03:39", "url": "https://files.pythonhosted.org/packages/6d/8e/8502447b94e9f51e4b02b17e8940ddb02b4121c29d82e28ddb6b71685d6f/django-sql-log-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "ccb8395bf072b5bbeea63083cf2d7351", "sha256": "70d0d94b37a78611965c55b4250306367125e4131e5f090dd40873e44b21c8d3" }, "downloads": -1, "filename": "django_sql_log-1.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "ccb8395bf072b5bbeea63083cf2d7351", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6299, "upload_time": "2015-06-10T10:20:25", "url": "https://files.pythonhosted.org/packages/45/03/bc417392c249dd9b95a2013b8387065433cb0bd7137277f8e9cc8a39b96f/django_sql_log-1.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74619c6c47c00fbd6e0310a987f85e3b", "sha256": "eba914e0cfaa200be3923f899e0eff76a782d8277cf946467671dba4d2c0b97f" }, "downloads": -1, "filename": "django-sql-log-1.2.1.tar.gz", "has_sig": false, "md5_digest": "74619c6c47c00fbd6e0310a987f85e3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4575, "upload_time": "2015-06-10T10:20:21", "url": "https://files.pythonhosted.org/packages/3e/89/f1cae5e471b3dab269ebe0d3353afd95f31a5c742f0a1fb3751c66a05a7b/django-sql-log-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ccb8395bf072b5bbeea63083cf2d7351", "sha256": "70d0d94b37a78611965c55b4250306367125e4131e5f090dd40873e44b21c8d3" }, "downloads": -1, "filename": "django_sql_log-1.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "ccb8395bf072b5bbeea63083cf2d7351", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6299, "upload_time": "2015-06-10T10:20:25", "url": "https://files.pythonhosted.org/packages/45/03/bc417392c249dd9b95a2013b8387065433cb0bd7137277f8e9cc8a39b96f/django_sql_log-1.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74619c6c47c00fbd6e0310a987f85e3b", "sha256": "eba914e0cfaa200be3923f899e0eff76a782d8277cf946467671dba4d2c0b97f" }, "downloads": -1, "filename": "django-sql-log-1.2.1.tar.gz", "has_sig": false, "md5_digest": "74619c6c47c00fbd6e0310a987f85e3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4575, "upload_time": "2015-06-10T10:20:21", "url": "https://files.pythonhosted.org/packages/3e/89/f1cae5e471b3dab269ebe0d3353afd95f31a5c742f0a1fb3751c66a05a7b/django-sql-log-1.2.1.tar.gz" } ] }