django-log-viewer


Namedjango-log-viewer JSON
Version 1.1.7 PyPI version JSON
download
home_pagehttps://github.com/agusmakmun/django-log-viewer
SummaryDjango log viewer
upload_time2023-01-27 14:07:15
maintainer
docs_urlNone
authorAgus Makmun (Summon Agus)
requires_python
licenseMIT
keywords django log viewer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            =================
Django Log Viewer
=================

|pypi version| |license| |build status|

Django Log Viewer allows you to read & download log files in the admin page by using ``DataTables``.
This project was modified from: https://bitbucket.org/inkalabsinc/django-log-viewer

-----------------

.. image:: https://i.imgur.com/kqxzIpX.png


Quick start
-----------

1. Django Log Viewer is available directly from `PyPI`_:

::

    pip install django-log-viewer


2. Add ``"log_viewer"`` to your ``INSTALLED_APPS`` setting like this

::

    INSTALLED_APPS = [
        ...
        "log_viewer",
    ]


3. Include the log viewer URLconf in your project ``urls.py`` like this

::

    path('logs/', include('log_viewer.urls')),


4. In your ``settings.py`` file create the following value

::

    LOG_VIEWER_FILES = ['logfile1', 'logfile2', ...]
    LOG_VIEWER_FILES_PATTERN = '*.log*'
    LOG_VIEWER_FILES_DIR = 'logs/'
    LOG_VIEWER_PAGE_LENGTH = 25       # total log lines per-page
    LOG_VIEWER_MAX_READ_LINES = 1000  # total log lines will be read
    LOG_VIEWER_FILE_LIST_MAX_ITEMS_PER_PAGE = 25 # Max log files loaded in Datatable per page
    LOG_VIEWER_PATTERNS = ['[INFO]', '[DEBUG]', '[WARNING]', '[ERROR]', '[CRITICAL]']
    LOG_VIEWER_EXCLUDE_TEXT_PATTERN = None  # String regex expression to exclude the log from line

    # Optionally you can set the next variables in order to customize the admin:
    LOG_VIEWER_FILE_LIST_TITLE = "Custom title"
    LOG_VIEWER_FILE_LIST_STYLES = "/static/css/my-custom.css"


5. Create/register the logging

::

    import logging
    logger = logging.getLogger('LoggerName')
    logger.info('The info message')
    logger.warning('The warning message')
    logger.error('The error message')

6. Deploy static files by running the command

::

    python manage.py collectstatic


7. Start the development server and visit http://127.0.0.1:8000/logs/


.. |pypi version| image:: https://img.shields.io/pypi/v/django-log-viewer.svg
   :target: https://pypi.python.org/pypi/django-log-viewer

.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg
   :target: https://raw.githubusercontent.com/agusmakmun/django-log-viewer/master/LICENSE

.. |build status| image:: https://img.shields.io/github/actions/workflow/status/agusmakmun/django-log-viewer/run-tests.yml?branch=master
   :target: https://github.com/agusmakmun/django-log-viewer/actions/workflows/run-tests.yml

.. _`PyPI`: https://pypi.python.org/pypi/django-log-viewer



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/agusmakmun/django-log-viewer",
    "name": "django-log-viewer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django log viewer",
    "author": "Agus Makmun (Summon Agus)",
    "author_email": "summon.agus@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/06/39/82301dbefadede58223efc3e8d30ddb113186f74b9e7cdd974f3a9fd8bb7/django-log-viewer-1.1.7.tar.gz",
    "platform": null,
    "description": "=================\nDjango Log Viewer\n=================\n\n|pypi version| |license| |build status|\n\nDjango Log Viewer allows you to read & download log files in the admin page by using ``DataTables``.\nThis project was modified from: https://bitbucket.org/inkalabsinc/django-log-viewer\n\n-----------------\n\n.. image:: https://i.imgur.com/kqxzIpX.png\n\n\nQuick start\n-----------\n\n1. Django Log Viewer is available directly from `PyPI`_:\n\n::\n\n    pip install django-log-viewer\n\n\n2. Add ``\"log_viewer\"`` to your ``INSTALLED_APPS`` setting like this\n\n::\n\n    INSTALLED_APPS = [\n        ...\n        \"log_viewer\",\n    ]\n\n\n3. Include the log viewer URLconf in your project ``urls.py`` like this\n\n::\n\n    path('logs/', include('log_viewer.urls')),\n\n\n4. In your ``settings.py`` file create the following value\n\n::\n\n    LOG_VIEWER_FILES = ['logfile1', 'logfile2', ...]\n    LOG_VIEWER_FILES_PATTERN = '*.log*'\n    LOG_VIEWER_FILES_DIR = 'logs/'\n    LOG_VIEWER_PAGE_LENGTH = 25       # total log lines per-page\n    LOG_VIEWER_MAX_READ_LINES = 1000  # total log lines will be read\n    LOG_VIEWER_FILE_LIST_MAX_ITEMS_PER_PAGE = 25 # Max log files loaded in Datatable per page\n    LOG_VIEWER_PATTERNS = ['[INFO]', '[DEBUG]', '[WARNING]', '[ERROR]', '[CRITICAL]']\n    LOG_VIEWER_EXCLUDE_TEXT_PATTERN = None  # String regex expression to exclude the log from line\n\n    # Optionally you can set the next variables in order to customize the admin:\n    LOG_VIEWER_FILE_LIST_TITLE = \"Custom title\"\n    LOG_VIEWER_FILE_LIST_STYLES = \"/static/css/my-custom.css\"\n\n\n5. Create/register the logging\n\n::\n\n    import logging\n    logger = logging.getLogger('LoggerName')\n    logger.info('The info message')\n    logger.warning('The warning message')\n    logger.error('The error message')\n\n6. Deploy static files by running the command\n\n::\n\n    python manage.py collectstatic\n\n\n7. Start the development server and visit http://127.0.0.1:8000/logs/\n\n\n.. |pypi version| image:: https://img.shields.io/pypi/v/django-log-viewer.svg\n   :target: https://pypi.python.org/pypi/django-log-viewer\n\n.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg\n   :target: https://raw.githubusercontent.com/agusmakmun/django-log-viewer/master/LICENSE\n\n.. |build status| image:: https://img.shields.io/github/actions/workflow/status/agusmakmun/django-log-viewer/run-tests.yml?branch=master\n   :target: https://github.com/agusmakmun/django-log-viewer/actions/workflows/run-tests.yml\n\n.. _`PyPI`: https://pypi.python.org/pypi/django-log-viewer\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Django log viewer",
    "version": "1.1.7",
    "split_keywords": [
        "django",
        "log",
        "viewer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "063982301dbefadede58223efc3e8d30ddb113186f74b9e7cdd974f3a9fd8bb7",
                "md5": "e14c189884709dc36f12237ccbf35cc2",
                "sha256": "eba39271fe8315836fe86fce27fc60730faecc7864e22a2cc363c3eb95a00b84"
            },
            "downloads": -1,
            "filename": "django-log-viewer-1.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "e14c189884709dc36f12237ccbf35cc2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 76608,
            "upload_time": "2023-01-27T14:07:15",
            "upload_time_iso_8601": "2023-01-27T14:07:15.869286Z",
            "url": "https://files.pythonhosted.org/packages/06/39/82301dbefadede58223efc3e8d30ddb113186f74b9e7cdd974f3a9fd8bb7/django-log-viewer-1.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-27 14:07:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "agusmakmun",
    "github_project": "django-log-viewer",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-log-viewer"
}
        
Elapsed time: 0.03314s