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

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

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

Uploaded Python 3

File details

Details for the file python_custom_logging-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_custom_logging-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4744cfe52a85be0a44cc0c837c5d86d92e073b26094ef68f875c591f251ab61d
MD5 5c4d1fc4330c142aab80ed992537f8b2
BLAKE2b-256 936aa2f3a1da72af809ed790616b1a42d28ae4ed01bbba732afe3aaea7ce4731

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