Skip to main content

Package to create log files with using TimedRotatingFileHandler

Project description

python_custom_logging

logpath = "YOUR LOG PATH/LOG_FILE_NAME.log"
loggername = "YOUR LOGGER NAME"
logformat = ("%(asctime)s [%(levelname)s]: %(lineno)d : %(message)s ") --YOUR LOG FORMAT
log_level = logging.INFO -- YOUR LOG LEVEL
logfilehandlertime = "H" -- logfilehandlertime (H,M,S)
interval = 1 - intreval of time 1 hour,1 sec ,1 minutes
backupCount=0 file we keep of logs if 0 mean all log file will be there and if set to 2 then latest 2 log file will be there and rest will be deleted

Create obj before use

from python_custom_logging import *

logging_config_obj=python_custom_logging(logpath,loggername,logformat,log_level,logfilehandlertime,interval,backupCount).create_log()

For Example:

logging_config_obj.info('YOUR LOGS')

logging_config_obj.error('YOUR LOGS')

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

python_custom_logging-1.0.1-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

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