Issue
My flask api shows which routes are being accessed in the dev environment. But when running behind gunicorn in production, all route access info is suppressed.
On heroku, I can still see route access info with the heroku logs --tail
command, but I just moved to EC2 and I am lost on where I might be able to get this info.
Is this something that I need to configure CloudWatch to be able to do?
Solution
You need to launch gunicorn with accesslog enabled.
To log to stdout
, similar to the flask dev server (with those log entries visible in the console):
--access-logfile -
Or if you want to send the log entries to a file, provide a filename:
--access-logfile FILE
Answered By - v25 Answer Checked By - Gilberto Lyons (WPSolving Admin)