mlogconfig
v0.2.5

This module provides a configurable logging setup for Python applications. It supports logging to console, file, syslog (for Linux and macOS), and Windows Event Log. The user can enable or disable each logging method as needed.
For Windows Event Log support, the following packages are required:
Install the required packages by running:
pip install pywin32Here is a basic example of using MLogConfig to set up logging for your application:
from mlogconfig import setup_logging
import logging
# Set up logging
setup_logging(
log_file_path="logs/app.log",
error_log_file_path="logs/app_error.log",
console_logging=True,
syslog_logging=True,
windows_event_logging=True,
log_level=logging.DEBUG,
)
# Use logging in your application
logging.info("This is an info log message.")
logging.error("This is an error log message.")To customize the logging configuration, modify the arguments passed to the setup_logging function. For example:
log_file_path: Path to the log fileerror_log_file_path: Path to the error log fileconsole_logging: Set to True to enable console logging, False otherwisesyslog_logging: Set to True to enable syslog logging (Linux and macOS only), False otherwisewindows_event_logging: Set to True to enable Windows Event Log logging, False otherwiselog_level: Set the logging level (e.g., logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)Contributions are welcome! Please read the contributing guidelines before submitting pull requests or opening issues.
MLogConfig is licensed under the MIT License.