atlas.logging_config.setup_logging

Details

Type: function

File: atlas/logging_config.py

Lines: 40–108

Signature: (level: str=DEFAULT_LOG_LEVEL, log_file: Path | str | None=DEFAULT_LOG_FILE, json_format: bool=False, console: bool=True, max_bytes: int=10 * 1024 * 1024, backup_count: int=5) -> logging.Logger

Docstring

Configure Atlas logging with rotating file and optional console handlers.

Parameters
----------
level:
    Minimum log level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
log_file:
    Path to the rotating log file. Set to None to disable file logging.
json_format:
    Write file logs as JSON lines if True; plain text otherwise.
console:
    Emit logs to stderr if True.
max_bytes:
    Maximum size of a single log file before rotation.
backup_count:
    Number of rotated log files to retain.

Returns
-------
The root Atlas logger.

Children

Name Type Line
atlas.logging_config.setup_logging.root_logger attribute 69

Actions

Analyse Impact Impact JSON