mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Merge pull request #11386 from AlanCoding/logs_on_the_fire
Remove dev-only log filters and downgrade periodic logs
This commit is contained in:
@@ -248,7 +248,7 @@ class WorkerPool(object):
|
|||||||
except Exception:
|
except Exception:
|
||||||
logger.exception('could not fork')
|
logger.exception('could not fork')
|
||||||
else:
|
else:
|
||||||
logger.warn('scaling up worker pid:{}'.format(worker.pid))
|
logger.debug('scaling up worker pid:{}'.format(worker.pid))
|
||||||
return idx, worker
|
return idx, worker
|
||||||
|
|
||||||
def debug(self, *args, **kwargs):
|
def debug(self, *args, **kwargs):
|
||||||
@@ -387,7 +387,7 @@ class AutoscalePool(WorkerPool):
|
|||||||
# more processes in the pool than we need (> min)
|
# more processes in the pool than we need (> min)
|
||||||
# send this process a message so it will exit gracefully
|
# send this process a message so it will exit gracefully
|
||||||
# at the next opportunity
|
# at the next opportunity
|
||||||
logger.warn('scaling down worker pid:{}'.format(w.pid))
|
logger.debug('scaling down worker pid:{}'.format(w.pid))
|
||||||
w.quit()
|
w.quit()
|
||||||
self.workers.remove(w)
|
self.workers.remove(w)
|
||||||
if w.alive:
|
if w.alive:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class AWXConsumerBase(object):
|
|||||||
return f'listening on {self.queues}'
|
return f'listening on {self.queues}'
|
||||||
|
|
||||||
def control(self, body):
|
def control(self, body):
|
||||||
logger.warn(body)
|
logger.warn(f'Received control signal:\n{body}')
|
||||||
control = body.get('control')
|
control = body.get('control')
|
||||||
if control in ('status', 'running'):
|
if control in ('status', 'running'):
|
||||||
reply_queue = body['reply_to']
|
reply_queue = body['reply_to']
|
||||||
@@ -137,7 +137,7 @@ class AWXConsumerPG(AWXConsumerBase):
|
|||||||
def run(self, *args, **kwargs):
|
def run(self, *args, **kwargs):
|
||||||
super(AWXConsumerPG, self).run(*args, **kwargs)
|
super(AWXConsumerPG, self).run(*args, **kwargs)
|
||||||
|
|
||||||
logger.warn(f"Running worker {self.name} listening to queues {self.queues}")
|
logger.info(f"Running worker {self.name} listening to queues {self.queues}")
|
||||||
init = False
|
init = False
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -188,7 +188,7 @@ class BaseWorker(object):
|
|||||||
if 'uuid' in body:
|
if 'uuid' in body:
|
||||||
uuid = body['uuid']
|
uuid = body['uuid']
|
||||||
finished.put(uuid)
|
finished.put(uuid)
|
||||||
logger.warn('worker exiting gracefully pid:{}'.format(os.getpid()))
|
logger.debug('worker exiting gracefully pid:{}'.format(os.getpid()))
|
||||||
|
|
||||||
def perform_work(self, body):
|
def perform_work(self, body):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ class TaskManager:
|
|||||||
update_fields = ['status', 'start_args']
|
update_fields = ['status', 'start_args']
|
||||||
workflow_job.status = new_status
|
workflow_job.status = new_status
|
||||||
if reason:
|
if reason:
|
||||||
logger.info(reason)
|
logger.info(f'Workflow job {workflow_job.id} failed due to reason: {reason}')
|
||||||
workflow_job.job_explanation = gettext_noop("No error handling paths found, marking workflow as failed")
|
workflow_job.job_explanation = gettext_noop("No error handling paths found, marking workflow as failed")
|
||||||
update_fields.append('job_explanation')
|
update_fields.append('job_explanation')
|
||||||
workflow_job.start_args = '' # blank field to remove encrypted passwords
|
workflow_job.start_args = '' # blank field to remove encrypted passwords
|
||||||
|
|||||||
@@ -795,7 +795,12 @@ LOGGING = {
|
|||||||
'job_lifecycle': {'()': 'awx.main.utils.formatters.JobLifeCycleFormatter'},
|
'job_lifecycle': {'()': 'awx.main.utils.formatters.JobLifeCycleFormatter'},
|
||||||
},
|
},
|
||||||
'handlers': {
|
'handlers': {
|
||||||
'console': {'()': 'logging.StreamHandler', 'level': 'DEBUG', 'filters': ['require_debug_true_or_test', 'guid'], 'formatter': 'simple'},
|
'console': {
|
||||||
|
'()': 'logging.StreamHandler',
|
||||||
|
'level': 'DEBUG',
|
||||||
|
'filters': ['require_debug_true_or_test', 'dynamic_level_filter', 'guid'],
|
||||||
|
'formatter': 'simple',
|
||||||
|
},
|
||||||
'null': {'class': 'logging.NullHandler'},
|
'null': {'class': 'logging.NullHandler'},
|
||||||
'file': {'class': 'logging.NullHandler', 'formatter': 'simple'},
|
'file': {'class': 'logging.NullHandler', 'formatter': 'simple'},
|
||||||
'syslog': {'level': 'WARNING', 'filters': ['require_debug_false'], 'class': 'logging.NullHandler', 'formatter': 'simple'},
|
'syslog': {'level': 'WARNING', 'filters': ['require_debug_false'], 'class': 'logging.NullHandler', 'formatter': 'simple'},
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ LOGGING['handlers']['console']['()'] = 'awx.main.utils.handlers.ColorHandler' #
|
|||||||
LOGGING['handlers']['task_system'] = LOGGING['handlers']['console'].copy() # noqa
|
LOGGING['handlers']['task_system'] = LOGGING['handlers']['console'].copy() # noqa
|
||||||
COLOR_LOGS = True
|
COLOR_LOGS = True
|
||||||
|
|
||||||
# celery is annoyingly loud when docker containers start
|
|
||||||
LOGGING['loggers'].pop('celery', None) # noqa
|
|
||||||
# avoid awx.main.dispatch WARNING-level scaling worker up/down messages
|
|
||||||
LOGGING['loggers']['awx.main.dispatch']['level'] = 'ERROR' # noqa
|
|
||||||
# suppress the spamminess of the awx.main.scheduler and .tasks loggers
|
|
||||||
LOGGING['loggers']['awx']['level'] = 'INFO' # noqa
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
mimetypes.add_type("image/svg+xml", ".svg", True)
|
mimetypes.add_type("image/svg+xml", ".svg", True)
|
||||||
@@ -57,13 +50,6 @@ CSRF_COOKIE_SECURE = False
|
|||||||
template = next((tpl_backend for tpl_backend in TEMPLATES if tpl_backend['NAME'] == 'default'), None) # noqa
|
template = next((tpl_backend for tpl_backend in TEMPLATES if tpl_backend['NAME'] == 'default'), None) # noqa
|
||||||
template['OPTIONS']['loaders'] = ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader')
|
template['OPTIONS']['loaders'] = ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader')
|
||||||
|
|
||||||
CALLBACK_QUEUE = "callback_tasks"
|
|
||||||
|
|
||||||
# Enable dynamically pulling roles from a requirement.yml file
|
|
||||||
# when updating SCM projects
|
|
||||||
# Note: This setting may be overridden by database settings.
|
|
||||||
AWX_ROLES_ENABLED = True
|
|
||||||
|
|
||||||
# Disable Pendo on the UI for development/test.
|
# Disable Pendo on the UI for development/test.
|
||||||
# Note: This setting may be overridden by database settings.
|
# Note: This setting may be overridden by database settings.
|
||||||
PENDO_TRACKING_STATE = "off"
|
PENDO_TRACKING_STATE = "off"
|
||||||
|
|||||||
Reference in New Issue
Block a user