diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 339e89bd40..fed14e4fa5 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -93,6 +93,9 @@ PROJECTS_ROOT = os.path.join(BASE_DIR, 'projects') # directory should not be web-accessible JOBOUTPUT_ROOT = os.path.join(BASE_DIR, 'job_output') +# Absolute filesystem path to the directory to store logs +LOG_ROOT = os.path.join(BASE_DIR) + # The heartbeat file for the tower scheduler SCHEDULE_METADATA_LOCATION = os.path.join(BASE_DIR, '.tower_cycle') @@ -558,7 +561,7 @@ LOGGING = { 'level': 'WARNING', 'class':'logging.handlers.RotatingFileHandler', 'filters': ['require_debug_false'], - 'filename': os.path.join(BASE_DIR, 'tower_warnings.log'), + 'filename': os.path.join(LOG_ROOT, 'tower_warnings.log'), 'maxBytes': 1024*1024*5, # 5 MB 'backupCount': 5, 'formatter':'simple', @@ -567,7 +570,7 @@ LOGGING = { 'level': 'WARNING', 'class':'logging.handlers.RotatingFileHandler', 'filters': ['require_debug_false'], - 'filename': os.path.join(BASE_DIR, 'callback_receiver.log'), + 'filename': os.path.join(LOG_ROOT, 'callback_receiver.log'), 'maxBytes': 1024*1024*5, # 5 MB 'backupCount': 5, 'formatter':'simple', @@ -576,7 +579,7 @@ LOGGING = { 'level': 'WARNING', 'class':'logging.handlers.RotatingFileHandler', 'filters': ['require_debug_false'], - 'filename': os.path.join(BASE_DIR, 'socketio_service.log'), + 'filename': os.path.join(LOG_ROOT, 'socketio_service.log'), 'maxBytes': 1024*1024*5, # 5 MB 'backupCount': 5, 'formatter':'simple', @@ -585,7 +588,7 @@ LOGGING = { 'level': 'INFO', 'class':'logging.handlers.RotatingFileHandler', 'filters': ['require_debug_false'], - 'filename': os.path.join(BASE_DIR, 'task_system.log'), + 'filename': os.path.join(LOG_ROOT, 'task_system.log'), 'maxBytes': 1024*1024*5, # 5 MB 'backupCount': 5, 'formatter':'simple', diff --git a/awx/settings/production.py b/awx/settings/production.py index 9ded1f47ca..e93f08e59e 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -44,7 +44,7 @@ JOBOUTPUT_ROOT = '/var/lib/awx/job_status/' # The heartbeat file for the tower scheduler SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle' -LOGGING['handlers']['rotating_file'] = { +LOGGING['handlers']['tower_warnings'] = { 'level': 'WARNING', 'class':'logging.handlers.RotatingFileHandler', 'filters': ['require_debug_false'], @@ -54,6 +54,37 @@ LOGGING['handlers']['rotating_file'] = { 'formatter':'simple', } + +LOGGING['handlers']['callback_receiver'] = { + 'level': 'WARNING', + 'class':'logging.handlers.RotatingFileHandler', + 'filters': ['require_debug_false'], + 'filename': '/var/log/tower/callback_receiver.log', + 'maxBytes': 1024*1024*5, # 5 MB + 'backupCount': 5, + 'formatter':'simple', +} + +LOGGING['handlers']['socketio_service'] = { + 'level': 'WARNING', + 'class':'logging.handlers.RotatingFileHandler', + 'filters': ['require_debug_false'], + 'filename': '/var/log/tower/socketio_service.log', + 'maxBytes': 1024*1024*5, # 5 MB + 'backupCount': 5, + 'formatter':'simple', +} + +LOGGING['handlers']['task_system'] = { + 'level': 'INFO', + 'class':'logging.handlers.RotatingFileHandler', + 'filters': ['require_debug_false'], + 'filename': '/var/log/tower/task_system.log', + 'maxBytes': 1024*1024*5, # 5 MB + 'backupCount': 5, + 'formatter':'simple', +} + # Load settings from any .py files in the global conf.d directory specified in # the environment, defaulting to /etc/tower/conf.d/. settings_dir = os.environ.get('AWX_SETTINGS_DIR', '/etc/tower/conf.d/')