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_app_logger(logging.INFO)


Or, configure a verbose file logger::

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

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dj_log_config_helper-0.1.0-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for dj_log_config_helper-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 415e849c3d0e51f4bf1b60ef297956b84fc290ee0ac78a68819c90ee0bb79ace
MD5 d100678e8cce14058083d0363855a19e
BLAKE2b-256 4d0016e8af61ec44c4f11c0a60911604d88b671a9d1e6d68f15712cd05e86411

See more details on using hashes here.

Supported by

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