diff --git a/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2 b/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2 index fa93ccecc5..42a5d56366 100644 --- a/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2 +++ b/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2 @@ -51,11 +51,18 @@ LOGGING['handlers']['otel'] |= { 'class': 'awx.main.utils.handlers.OTLPHandler', 'endpoint': 'http://otel:4317', } -# Add otel log handler to all log handlers +# Add otel log handler to all log handlers where propagate is False for name in LOGGING['loggers'].keys(): - handler = LOGGING['loggers'][name].get('handlers', []) - if 'otel' not in handler: - LOGGING['loggers'][name].get('handlers', []).append('otel') + if not LOGGING['loggers'][name].get('propagate', True): + handler = LOGGING['loggers'][name].get('handlers', []) + if 'otel' not in handler: + LOGGING['loggers'][name].get('handlers', []).append('otel') + +# Everything without explicit propagate=False ends up logging to 'awx' so add it +handler = LOGGING['loggers']['awx'].get('handlers', []) +if 'otel' not in handler: + LOGGING['loggers']['awx'].get('handlers', []).append('otel') + {% endif %} BROADCAST_WEBSOCKET_PORT = 8013