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 configture. This module support TimeRotatingHandler, MultiProcessTimeRotatingHandler, 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

Source

https://github.com/amazingcoderpro/log_config

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-2.1.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distributions

log_config-2.1.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

log_config-2.1.1-py2.py3-none-any.whl (18.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: log_config-2.1.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for log_config-2.1.1.tar.gz
Algorithm Hash digest
SHA256 8923673189bab84751e58e1eb4b37d81a098211cd4be1708b433e4ee518ee9dc
MD5 beb96ca397f5b9d17bdb47cd74d94930
BLAKE2b-256 74f7926284a97cfe45e200c490d6a4cf00062278097c6dc53d342b8ad9d6ed12

See more details on using hashes here.

File details

Details for the file log_config-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: log_config-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for log_config-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2f58c937ab6261fa7071ac6741962363f36d3117f39d7c86a834be916457374
MD5 c2cb2a37a67cd7dc3c6b8533cca6c69e
BLAKE2b-256 3806e0ed8a9974e0654177b5bdba05a133032dce39a4d968465aa39b4fded4eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: log_config-2.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for log_config-2.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 98d9ad5ef23f0abb31e6d3cadb6322f933e498bb3d3c9a79b03563bed85efbaa
MD5 8d57eb2560539d7f99713ccb301b9332
BLAKE2b-256 323af67fe099212581ea29c3ef7dbefb8a9891782f371af8754622658a3d5054

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