Skip to content

Commit

Permalink
Merge pull request #88 from gwu-libraries/t87-apache_logs
Browse files Browse the repository at this point in the history
refs #87. Redirected apache logs to stdout/stderr and updated docs.
  • Loading branch information
justinlittman committed Dec 30, 2015
2 parents 66c5909 + b2e6a74 commit 395d116
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docker/app-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ RUN a2dissite 000-default
#Data volume
ADD invoke.sh /opt/
RUN chmod +x /opt/invoke.sh
#Forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stderr /var/log/apache2/error.log
WORKDIR /opt/sfm-ui
ENV DJANGO_SETTINGS_MODULE=sfm.settings.docker_settings
CMD ["/opt/invoke.sh"]
Expand Down
3 changes: 3 additions & 0 deletions docker/app-master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ RUN mkdir /var/sfm && chmod ugo+w /var/sfm
VOLUME /var/sfm
ADD invoke.sh /opt/
RUN chmod +x /opt/invoke.sh
#Forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stderr /var/log/apache2/error.log
WORKDIR /opt/sfm-ui
CMD ["/opt/invoke.sh"]
ENV DJANGO_SETTINGS_MODULE=sfm.settings.docker_settings
Expand Down
3 changes: 3 additions & 0 deletions docker/app-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ RUN mkdir /var/sfm && chmod ugo+w /var/sfm
VOLUME /var/sfm
ADD invoke.sh /opt/
RUN chmod +x /opt/invoke.sh
#Forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stderr /var/log/apache2/error.log
WORKDIR /opt/sfm-ui
CMD ["/opt/invoke.sh"]
ENV DJANGO_SETTINGS_MODULE=sfm.settings.docker_settings
Expand Down
7 changes: 2 additions & 5 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,8 @@ the SFM UI application is called ui and is controlled by the `SFM_UI_LOG` enviro

Apache logs
^^^^^^^^^^^
SFM UI runs behind Apache, which means Apache collects stdout and stderr in `/var/log/apache2/error.log`.

The contents of error.log can be viewed with::

docker exec <name of your container> cat /var/log/apache2/error.log
In the SFM UI container, Apache logs are sent to stdout/stderr which means they can be viewed with
`docker-compose logs` or `docker logs <container name or id>`.

Initial data
^^^^^^^^^^^^
Expand Down

0 comments on commit 395d116

Please sign in to comment.