Skip to content

Commit

Permalink
Merge pull request #153 from hubmapconsortium/yuanzhou/log-2-aws
Browse files Browse the repository at this point in the history
Forward docker logs to AWS
  • Loading branch information
yuanzhou authored Nov 17, 2023
2 parents 884f750 + ce46415 commit d49eeed
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 @@ -57,6 +57,9 @@ instance/

**/venv/

# Ignore docker env file
.env

server/BUILD
server/VERSION
BUILD
7 changes: 7 additions & 0 deletions docker-compose.deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ services:
- ./server/log:/app/server/log
- ./VERSION:/app/server/VERSION
- ./BUILD:/app/server/BUILD
# Send docker logs to AWS CloudWatch
logging:
driver: awslogs
options:
awslogs-region: us-east-1
awslogs-group: antibody-api-docker-logs
awslogs-stream: ${LOG_STREAM}

networks:
gateway_hubmap:
Expand Down
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LOG_STREAM=DEV
5 changes: 3 additions & 2 deletions server/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ chdir = /app/server
# Application's callable
module = wsgi:application

# Location of uwsgi log file
logto = /app/server/log/uwsgi-antibody-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 2 worker process (based on CPU number)
master = true
Expand Down

0 comments on commit d49eeed

Please sign in to comment.