Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

upgraded gunicorn, removed deprecated flag, and added timezone to logging #519

Merged
merged 1 commit into from
Aug 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ sudo python-pip install docker-registry[bugsnag]
#### Run it

```
gunicorn --access-logfile - --debug -k gevent -b 0.0.0.0:5000 -w 1 docker_registry.wsgi:application
gunicorn --access-logfile - -k gevent -b 0.0.0.0:5000 -w 4 --max-requests 100 docker_registry.wsgi:application
```

### How do I setup user accounts?
Expand Down
3 changes: 2 additions & 1 deletion docker_registry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# logging has been configured
cfg = config.load()
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=getattr(logging, cfg.loglevel.upper()))
level=getattr(logging, cfg.loglevel.upper()),
datefmt="%d/%b/%Y:%H:%M:%S %z")
Copy link
Contributor

Choose a reason for hiding this comment

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

Ping @shin- - any objection to that? anything we do with the logs in production?


from .lib import mirroring
from .server import __version__
Expand Down
2 changes: 1 addition & 1 deletion docker_registry/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
GUNICORN_GROUP: unix group to downgrade priviledges to
GUNICORN_ACCESS_LOG_FILE: File to log access to
GUNICORN_ERROR_LOG_FILE: File to log errors to
GUNICORN_OPTS: extra options to pass to gunicorn
"""


Expand Down Expand Up @@ -70,7 +71,6 @@ def run_gunicorn():
gunicorn_path, 'gunicorn',
'--access-logfile', env.source('GUNICORN_ACCESS_LOG_FILE'),
'--error-logfile', env.source('GUNICORN_ERROR_LOG_FILE'),
'--debug',
'--max-requests', '100',
'-k', 'gevent',
'--graceful-timeout', env.source('GUNICORN_GRACEFUL_TIMEOUT'),
Expand Down
3 changes: 0 additions & 3 deletions docker_registry/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
port = env.source('REGISTRY_PORT')
app.debug = True
app.run(host=host, port=port)
# Or you can run:
# gunicorn --access-logfile - --log-level debug --debug -b 0.0.0.0:5000 \
# -w 1 wsgi:application
else:
# For uwsgi
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the --debug switch? (here and elsewhere)

Copy link
Contributor

Choose a reason for hiding this comment

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

On Tue, Aug 12, 2014 at 09:27:49AM -0700, Olivier Gambier wrote:

@@ -23,7 +23,7 @@
app.debug = True
app.run(host=host, port=port)
# Or you can run:

  • gunicorn --access-logfile - --log-level debug --debug -b 0.0.0.0:5000 \

Why remove the --debug switch?

Because it's useless ;) [1,2].

Copy link
Contributor

Choose a reason for hiding this comment

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

Removing useless stuff indeed seems like an acceptable reason (note that in v18, --debug or its absence had strange side-effects on logging IIRC) - but since we are moving up, I'm happy :-)

app.logger.setLevel(logging.INFO)
Expand Down
2 changes: 1 addition & 1 deletion requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ blinker==1.3
Flask==0.10.1
Flask-cors==1.3.0
gevent==1.0.1
gunicorn==18.0
gunicorn==19.1
PyYAML==3.11
requests==2.3.0
rsa==3.1.4
Expand Down