Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-89 [deploy/stack2] Log to file with uWSGI: #90

Merged
merged 3 commits into from
Jan 16, 2018

Conversation

MagicJohnJang
Copy link
Contributor

  • Log to /tmp/flask-stack2.log.{timestamp} (Use timestamp if file size over 100MB)
  • Enable volume /tmp in api-server container.
  • Mapping host and container within /tmp folder.

Enable mutli-thread support.

* Log to /tmp/flask-stack2.log.{timestamp}  (Use timestamp if file size over 100MB)
* Enable volume `/tmp` in api-server container.
* Mapping host and container within `/tmp` folder.

Enable mutli-thread support.
@MagicJohnJang MagicJohnJang changed the title [deploy/stack2] Log to file with uWSGI: Issue-89 [deploy/stack2] Log to file with uWSGI: Dec 29, 2017
@coveralls
Copy link

coveralls commented Dec 29, 2017

Coverage Status

Coverage remained the same at 94.13% when pulling e08a668 on MagicJohnJang:issue-89-log-to-file-with-uwsgi into 3f3ad74 on frol:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.13% when pulling e08a668 on MagicJohnJang:issue-89-log-to-file-with-uwsgi into 3f3ad74 on frol:master.

@@ -11,11 +11,13 @@ services:

api:
restart: always
volumes:
- "/tmp:/tmp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look to me like a sane default. Let's drop this auto-mounting.

build:
context: ../../
args:
INCLUDE_UWSGI: 'true'
environment:
EXAMPLE_API_REVERSE_PROXY_SETUP: 'true'
FLASK_CONFIG: 'production'
command: 'uwsgi --need-app --manage-script-name --mount /=app:create_app() --uwsgi-socket 0.0.0.0:5000'
command: 'uwsgi --need-app --manage-script-name --mount /=app:create_app() --uwsgi-socket 0.0.0.0:5000 --enable-threads --logger file:logfile=/tmp/flask-stack2.log,maxsize=104857600'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. --enable-threads should not be used unless there is a need as it hurts performance (it enables GIL).
  2. Given that file logs are not that common in Docker environments I would rather prefer having the information about the logger in the README file. Could you document it there and revert the direct changes to the Dockerfile and docker-compose.yml?

@frol frol merged commit acbd70b into frol:master Jan 16, 2018
@frol
Copy link
Owner

frol commented Jan 16, 2018

@MagicJohnJang Thank you!

@coveralls
Copy link

coveralls commented Jan 16, 2018

Coverage Status

Coverage remained the same at 94.13% when pulling f2396f4 on MagicJohnJang:issue-89-log-to-file-with-uwsgi into 3f3ad74 on frol:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.13% when pulling f2396f4 on MagicJohnJang:issue-89-log-to-file-with-uwsgi into 3f3ad74 on frol:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.13% when pulling f2396f4 on MagicJohnJang:issue-89-log-to-file-with-uwsgi into 3f3ad74 on frol:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants