Skip to main content

Provide a function for anyone who want to configure log parameters easily, just call init_log_config when your app start up, the you can use the module of logging which build-in python3 without any other configtur. This module support ConsoleHandler, RotatingFileHandler and SMTPHandler and You can change the configuration parameters according to your requirements.

Project description

Provide a function for anyone who want to configure log parameters easily, just call init_log_config when your app start up, the you can use the module of logging which build-in python3 without any other configtur. This module support ConsoleHandler, RotatingFileHandler and SMTPHandler and You can change the configuration parameters according to your requirements.

Meta

Installation

Simply run the following from within a virtualenv:

    $ pip install log_config

    or

$ pip install git+https://github.com/wcadaydayup/log_config

Usage

Import the log config function in anywhere you want use logging which build-in Python3:

from log_config.log_config import init_log_config

Call init_log_config() when your application start up, of course you can modify log file path, log level and so on by import other variable from log_config.log_config:

init_log_config()

Log confiture is ready, you can use logging module without any other configture:

import logging
    logger = logging.getLogger()
    logger.debug("this is a message of debug level.")

Then, you will see you output message in console and log file which in your current directory:

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

You can also receive email notify if call init_log_config(use_mail=True), of course you should provide correct email parameters:

    import log_config.log_config as lf
    lf.EMAIL_HOST = "xxx.smtp.com"
    lf.FROM = "youraccount@xx.com"
    lf.TO = "a@xx.com;b@xx.com"

    ...

init_log_config(use_mail=True)

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

log_config-1.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

log_config-1.3-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file log_config-1.3.tar.gz.

File metadata

  • Download URL: log_config-1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for log_config-1.3.tar.gz
Algorithm Hash digest
SHA256 5be3c0061d65fd26a1848dfbb365d77f1cad54b1b7ce88b0b061a071a0d0fea7
MD5 57935d37e23c6bcbf1369bf62720a0ba
BLAKE2b-256 93e07d8405d938ff10a790262da6fcab5378fb18492193d8f8b28e391d705b9a

See more details on using hashes here.

File details

Details for the file log_config-1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: log_config-1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for log_config-1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f1dce06f93f20a09af9728dd08b13136e9e7b16cd250d09402a74b9cd469ba7c
MD5 3f38c9161a4416ae26d728da9e880bb8
BLAKE2b-256 9e4600bd1eb58d9cfe1c3450aaf270a21d003d17f6c1650e93e3c572466bfc44

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