The Multi Python Logger is a versatile logging utility designed to simplify and enhance the logging process in Python applications. It supports logging to local files and integrates seamlessly with AWS CloudWatch, providing a unified interface for all your logging needs. Whether you're developing a small script or a large-scale application, this logger ensures your logs are easily accessible and well-organized..
Install multi_python_logger
:
pip install multi_python_logger
from multi_python_logger import logger
logger.log("info", msg="This is the sample message", module_name="app",error_code="1001" )
Automatically logs messages to a local file for easy access and review. To set the file logger set the environment variable
LOGGING_TYPE = "file"
Send your logs directly to AWS CloudWatch, enabling centralized log management and monitoring.
To set the Cloudwatch logging set the following environement variables
LOGGING_TYPE = "cloudwatch"
CLOUDWATCH_LOG_GROUP = ""
CLOUDWATCH_STREAM_NAME = ""
AWS_REGION = ""
AWS_ACCESS_KEY = ""
AWS_SECRET_KEY = ""
Send your logs directly to MongoDB, enabling centralized log management and monitoring.
To set the MongoDB logging set the following environement variables
LOGGING_TYPE = "mongodb"
MONGODB_URI = "" #default set as "mongodb://localhost:27018"
MONGODB_DB = "" #default set as logs
MONGODB_COLLECTION = "" #log_entries