Skip to main content

Simplify log configuration across Django projects

Project description

Copyright (c) 2016 Harvard University / iCommons

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: ====================
Dj-Log-Config-Helper
====================

Centralize management of simple log configuration across Django projects

The ``dj_log_config_helper.configure_installed_apps_logger`` method configures either a console or file logger with a list of all the top-level app module packages being installed in ``INSTALLED_APPS``. Use this method in your ``settings.py`` file.

Meta
----

* Author: Jaime Bermudez
* Email: jaime_bermudez@harvard.edu
* Maintainer: Harvard University Academic Technology
* Email: tlt-ops@g.harvard.edu
* Status: active development, stable, maintained


Installation
------------
Simply run the following from within a virtualenv::

$ pip install git+https://github.com/Harvard-University-iCommons/dj-log-config-helper

Running the tests
-----------------
Via make::

$ make test

Usage
-----
Import the log config function in ``settings.py``::

from dj_log_config_helper import configure_installed_apps_logger

Disable Django's default logging::

LOGGING_CONFIG = None

At the end of ``settings.py`` configure a simple console logger::

configure_installed_apps_logger(logging.INFO)

Or, configure a verbose file logger::

configure_installed_apps_logger(logging.INFO, verbose=True, filename='django-project.log')

You can also log additional packages that are not part of INSTALLED_APPS::

configure_installed_apps_logger(logging.INFO, additional_packages=['py.warnings'])

Platform: any
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj-log-config-helper-0.2.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

dj_log_config_helper-0.2.3-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dj-log-config-helper-0.2.3.tar.gz.

File metadata

File hashes

Hashes for dj-log-config-helper-0.2.3.tar.gz
Algorithm Hash digest
SHA256 0b1a30309a368cfd0c0e9848b98d05102ba520bbf301ef99d4d1307c1b764195
MD5 c502716b5b1705263d1a994627f43e0e
BLAKE2b-256 4ad2ddb9aa7b7b7fe377178590d76f71d19115349674e3b08e03d9eade2b1b8d

See more details on using hashes here.

File details

Details for the file dj_log_config_helper-0.2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dj_log_config_helper-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 83feaf9119ad31e3dbbe16201663c04ecf2a2297f35201722ecaf67c04589d4a
MD5 1c36336cccf9d4559edd81c35a7c08e1
BLAKE2b-256 8e0ad6b83e9455fca98c1ca8b056f638574fa0cb25c867bb8fd7c011e26e7f34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page