mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 14:42:24 -05:00
Implement worker_abort server hook
Also update the manifest command to pass the config file in as a parameter and modify the logs agent to start shipping the error log to cloudwatch
This commit is contained in:
5
gunicorn_config.py
Normal file
5
gunicorn_config.py
Normal file
@@ -0,0 +1,5 @@
|
||||
def worker_abort(worker):
|
||||
worker.log.info("worker received ABORT")
|
||||
import sys, traceback
|
||||
for threadId, stack in sys._current_frames().items():
|
||||
worker.log.info(''.join(traceback.format_stack(stack)))
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
buildpack: python_buildpack
|
||||
command: scripts/run_app_paas.sh gunicorn --error-logfile /home/vcap/logs/gunicorn_error.log -w 5 -b 0.0.0.0:$PORT wsgi
|
||||
command: scripts/run_app_paas.sh gunicorn -c /home/vcap/app/gunicorn_config.py --error-logfile /home/vcap/logs/gunicorn_error.log -w 5 -b 0.0.0.0:$PORT wsgi
|
||||
services:
|
||||
- notify-aws
|
||||
- notify-config
|
||||
|
||||
@@ -29,6 +29,11 @@ state_file = /home/vcap/logs/awslogs-state
|
||||
file = /home/vcap/logs/app.log.json
|
||||
log_group_name = paas-${CW_APP_NAME}-application
|
||||
log_stream_name = {hostname}
|
||||
|
||||
[/home/vcap/logs/gunicorn_error.log]
|
||||
file = /home/vcap/logs/gunicorn_error.log
|
||||
log_group_name = paas-${CW_APP_NAME}-gunicorn
|
||||
log_stream_name = {hostname}
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user