mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Rework which loggers we sent to OTEL
* Send all propagate=False loggers to OTEL AND the awx logger
This commit is contained in:
parent
cae42653bf
commit
6df47c8449
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user