G.O.D Framework

Documentation: config_logging.json

Comprehensive logging configuration for the G.O.D Framework.

Introduction

The config_logging.json file is an essential component of the G.O.D Framework that dictates logging behavior across the system. It controls where logs are stored, their formatting, rotation schedules, and the logging levels for debugging, info tracking, and error monitoring. This configuration is built in JSON format to ensure compatibility with various libraries and platforms.

Purpose

The key objectives of config_logging.json are:

Structure

The configuration file is structured as a JSON object with nested fields. Below is a detailed example:


{
    "version": 1,
    "disable_existing_loggers": false,
    "formatters": {
        "detailed": {
            "format": "%(asctime)s | %(name)s | %(levelname)s | %(message)s"
        },
        "simple": {
            "format": "%(levelname)s | %(message)s"
        }
    },
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
            "level": "DEBUG",
            "formatter": "simple",
            "stream": "ext://sys.stdout"
        },
        "file": {
            "class": "logging.handlers.RotatingFileHandler",
            "level": "INFO",
            "formatter": "detailed",
            "filename": "/var/log/god_framework/app.log",
            "maxBytes": 10485760,
            "backupCount": 5,
            "encoding": "utf8"
        }
    },
    "loggers": {
        "": {
            "level": "INFO",
            "handlers": ["console", "file"],
            "propagate": true
        }
    }
}
        

This JSON configuration is divided into several key sections:

Key Fields

Integration with the G.O.D Framework

The config_logging.json file integrates seamlessly across all modules in the framework:

Best Practices

Future Enhancements