Skip to content

Commit

Permalink
Merge pull request #717 from hubmapconsortium/yuanzhou/log
Browse files Browse the repository at this point in the history
Yuanzhou/log
  • Loading branch information
yuanzhou authored Nov 1, 2023
2 parents a5cfb72 + 330bc6c commit 96c6e2e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ src/instance/search-config.yaml

**/__pycache__/

# Ignore docker env file
docker/.env

# Docker copied files and directories
docker/search-api/src
docker/search-api/VERSION
Expand Down
7 changes: 7 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ services:
- "./search-api/nginx/conf.d:/etc/nginx/conf.d"
networks:
- gateway_hubmap
# Send docker logs to AWS CloudWatch
logging:
driver: awslogs
options:
awslogs-region: us-east-1
awslogs-group: search-api-docker-logs
awslogs-stream: ${LOG_STREAM}

networks:
# This is the network created by gateway to enable communicaton between multiple docker-compose projects
Expand Down
1 change: 1 addition & 0 deletions docker/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LOG_STREAM=DEV
5 changes: 3 additions & 2 deletions src/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ chdir = /usr/src/app/src
# Application's callbale
module = wsgi:application

# Location of uwsgi log file
logto = /usr/src/app/log/uwsgi-search-api.log
# Delegate the logging to the master process
# Send logs to stdout instead of file so docker picks it up and writes to AWS CloudWatch
log-master=true

# Master with 4 worker process (based on CPU number)
master = true
Expand Down

0 comments on commit 96c6e2e

Please sign in to comment.