diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index 6c49cadd043..08d66f9ec4a 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -1113,6 +1113,9 @@ EDXAPP_COMPLETION_AGGREGATOR_URL: null edxapp_data_dir: "{{ COMMON_DATA_DIR }}/edxapp" edxapp_app_dir: "{{ COMMON_APP_DIR }}/edxapp" edxapp_log_dir: "{{ COMMON_LOG_DIR }}/edx" +edxapp_gunicorn_log_dir: + - "{{ COMMON_LOG_DIR }}/gunicorn-lms" + - "{{ COMMON_LOG_DIR }}/gunicorn-cms" edxapp_venvs_dir: "{{ edxapp_app_dir }}/venvs" edxapp_venv_dir: "{{ edxapp_venvs_dir }}/edxapp" edxapp_venv_bin: "{{ edxapp_venv_dir }}/bin" diff --git a/playbooks/roles/edxapp/tasks/main.yml b/playbooks/roles/edxapp/tasks/main.yml index 8e6d57440a6..c59af3d1d53 100644 --- a/playbooks/roles/edxapp/tasks/main.yml +++ b/playbooks/roles/edxapp/tasks/main.yml @@ -59,6 +59,18 @@ - install - install:base +- name: create edxapp gunicorn log dirs + file: + path: "{{ item }}" + state: directory + owner: "{{ common_log_user }}" + group: "{{ common_log_user }}" + with_items: + - "{{ edxapp_gunicorn_log_dir }}" + tags: + - install + - install:base + - name: Ensure the tracking folder exists file: path: "{{ COMMON_LOG_DIR }}/tracking" diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 index c2f20ce3a16..04fcb660260 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 @@ -51,4 +51,4 @@ export EDX_REST_API_CLIENT_NAME="{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT } source {{ edxapp_app_dir }}/edxapp_env # We exec so that gunicorn is the child of supervisor and can be managed properly -exec {{ executable }} -c {{ edxapp_app_dir }}/cms_gunicorn.py {{ EDXAPP_CMS_GUNICORN_EXTRA }} cms.wsgi +exec {{ executable }} -c {{ edxapp_app_dir }}/cms_gunicorn.py {{ EDXAPP_CMS_GUNICORN_EXTRA }} cms.wsgi --log-file {{ edxapp_gunicorn_log_dir[1] }}/edx.log diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 index 730f313a060..c762724f443 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 @@ -52,4 +52,4 @@ export EDX_REST_API_CLIENT_NAME="{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT } source {{ edxapp_app_dir }}/edxapp_env # We exec so that gunicorn is the child of supervisor and can be managed properly -exec {{ executable }} -c {{ edxapp_app_dir }}/lms_gunicorn.py lms.wsgi +exec {{ executable }} -c {{ edxapp_app_dir }}/lms_gunicorn.py lms.wsgi --log-file {{ edxapp_gunicorn_log_dir[0] }}/edx.log