200 Commits

Author SHA1 Message Date
Benoit Chesneau
5f11713678 log HTTP errors in access log. close #317 2012-04-26 18:17:55 +02:00
benoitc
961eabb332 simplify the code 2012-03-16 21:10:44 +01:00
benoitc
1319543448 use the cached app. 2012-03-01 08:02:15 +01:00
benoitc
ce907348ef close #306 .
We badly called this function `start_server` when it should have been
`when_ready` .
2012-02-29 14:09:49 +01:00
benoitc
5a7c756a98 close #304 .
Intoduce a change in log access format:

- request headers are now added to the log format using the
  {HeaderName}i variable
- response headers are now handled using the {HeaderName}o variables
- headers name are insensitive
- non existent keys in the log access format are replaced by '-'
2012-02-25 14:44:38 +01:00
benoitc
f67993eb87 fix testing.
Note: it was also a good way to test HUP on master. worked like a charm.
2012-02-21 12:34:50 +01:00
benoitc
98f57f3daf add admin so we can test with SQL eventually 2012-02-20 22:17:36 +01:00
benoitc
cc26270783 close #170 .
add --check-config option to check the config and app loading.
2012-02-20 11:13:59 +01:00
benoitc
fd3fae1afd add app to test django 1.4 2012-02-19 22:09:32 +01:00
benoitc
cc43f89ef5 compatibility with django 1.4 and more related fixes.
- handle new way to launch applications in django 1.4
- simplify the way we discover the project path and settings
- add --pythonpath & --settings options for django applications
- still compatible with older versions (>=1.1)
-handle DJANGO_SETTINGS_MODULE env.

close #283, #275, #274, #241
2012-02-19 21:56:41 +01:00
benoitc
cc99181cee logging.fileConfig support is back. 2012-02-19 17:07:42 +01:00
benoitc
85c60c26b5 redirect stdout & stderr to logging error file when output is different
from '-' . Useful to collect some errors.
2012-02-19 16:07:51 +01:00
Randall Leeds
f02b0d9cca update longpoll examples
Add a longpoll example for tornado and terminate the lines we send with
a '\n'.
2011-11-07 17:14:37 -08:00
benoitc
3acf75338f add accesslog example 2011-09-28 12:36:43 +02:00
benoitc
428c7a3b5e put back logging confing in gunicorn_paster. spotted by @oit on github.
thanks!
2011-08-22 09:45:06 +02:00
benoitc
66f7271c5f Use our own logger object to log events in gunicorn. While I'm here add
the possibility to manage an access log compatible with apache combined
log format. reopening files is also handled. Also, this change fix
issues #237 and #190.

For the sake of simplicity logging file have been removed

--logfile option has become --error-logfile, by default "-"

Following options have been added:

--access-logfile, the access log file path. By default None. If set
access logs will bre written to defined output

eg:

$ gunicorn -w3 --access-logfile=- test:app
2011-08-21 19:36:52 [84572] [INFO] Starting gunicorn 0.13.0
2011-08-21 19:36:52 [84572] [INFO] Listening at: http://127.0.0.1:8000
(84572)
2011-08-21 19:36:52 [84572] [INFO] Using worker: sync
2011-08-21 19:36:52 [84573] [INFO] Booting worker with pid: 84573
2011-08-21 19:36:52 [84574] [INFO] Booting worker with pid: 84574
2011-08-21 19:36:52 [84575] [INFO] Booting worker with pid: 84575
127.0.0.1 - - [21/Aug/2011:19:37:04] "GET / HTTP/1.1" 200 14 "-"
"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r
zlib/1.2.5"
2011-08-21 21:08:58 +02:00
benoitc
17b47a376b get settings module name on fork rather than on app initialization. It
allows people to use relative path in their projects. fix issues #219,
and #213
2011-08-21 07:31:58 +02:00
benoitc
0f53a83f49 main problem of current run_gunicorn reload behaviour is that settings
aren't correctly reloaded. First attempt to remove it from sys.modules
introduced more problem than it solved.

This new attempt, just get the module, reload it and populate currently
loaded settings with new values.
2011-06-25 10:28:27 +02:00
Keegan Carruthers-Smith
133a85e4ee Updated docs to reflect the proper alternative syntax for specifying a worker class. 2011-06-25 09:19:05 +02:00
benoitc
76aef105d5 fix django example to work with 1.3 . 2011-05-18 18:22:55 +02:00
WoLpH
179b87639c removed python string formatting from logging to enable log message grouping 2011-05-11 23:11:36 +02:00
benoitc
c17f7230e8 refactor sendfile and add an example. 2011-05-11 23:11:02 +02:00
benoitc
fcab6bc144 after multiple attempts it's easier to just reload the app. People using
mange.py have to use USR2 signal if they want to upgrade the django
version instread of HUP. On the other hand, upgrading django version
with HUP is possible with gunicorn_django command.
2011-05-11 23:11:02 +02:00
benoitc
239010a476 update doc 2011-03-23 07:46:55 +01:00
benoitc
374bb7bfff add pyramid app example 2011-03-23 07:32:37 +01:00
Neil Chintomby
06987d3702 add server hook "on_starting" to allow socket patching to allow gevent worker reloading. 2011-03-14 23:28:33 -04:00
Justin Quick
76a0d7ae83 typo 2011-02-05 10:50:37 +08:00
benoitc
8e80328114 add support for logging configuration using a ini file. It uses the
standard Python logging's module Configuration file format
(http://docs.python.org/library/logging.html#configuration-file-format)
and allows anyone to use his custom file handler. Fix issues #117 and #111.
2010-12-12 16:13:10 +01:00
benoitc
46bde6af85 add multidomainapp example from Anand Chitipothu. Fix issue #99. Thanks! 2010-11-20 21:18:32 +01:00
Ben Cochran
e7938fa3df Fixed incorrect example config. (Since 036f8b5 it's been pre/post for hooks, not before/after) 2010-10-30 15:56:23 +08:00
benoitc
cae9b0bece fix gunicorn paster. Now we have real HUP with paster. Also use paster
logging everywhere.
2010-10-22 06:59:46 +02:00
Oliver Tonnhofer
d546d490e5 add support for logging configuration in paster ini-files 2010-10-22 05:49:49 +02:00
Travis Swicegood
2209c83c3e fix minor typo in docs so it matches the code 2010-09-18 19:53:39 +02:00
Travis Cline
8e1bab434e Moved the gevent import later as it's causing gunicorn to fail to load when using this example hook. 2010-09-13 18:10:27 +08:00
benoitc
7715199b48 it's better to test when you use the right code to do it. We had a
blocking operation django example (we read a file already on the fs and
recreate another which blocked async schedulers).

While I'm here ease the code of eventlet worker. Just use the convenient
eventlet.serve function which already manage what we do and revert sopme
useless changes in body and header parsing.
2010-09-02 14:55:56 +02:00
benoitc
bbe7e46695 Rails hasn't been ported to Python yet. 2010-08-31 11:26:03 +02:00
Paul J. Davis
3165b0f87f Fix a typo in the documentation.
Some examples had -C instead of -c for specifying the config file. Thanks
to martync@github for the report.

Fixes #86
2010-08-30 11:54:52 -04:00
benoitc
d07009a12f we cant to challenge worker timeout here. 2010-08-12 13:13:21 +02:00
Paul J. Davis
63b53c9f51 Exit with a non-zero status if workers don't boot.
Raising a HaltServer exception in the arbiter will now exit with the
provided reason and status code.
2010-08-05 23:28:25 -04:00
Paul J. Davis
1f598b9b74 Move the WebSocket to a directory so its linkable.
As in, link for pasting into an email.
2010-07-31 11:40:48 -04:00
benoitc
9af95b7f8d osi.waitpid patching is broken in eventlet and prevent arbiter to exit.
Waiting upstream fixes, don't patch it for now.
2010-07-08 19:30:55 +02:00
benoitc
b2db9df58f update eventlet websocket example and fix gevent one 2010-07-08 18:49:15 +02:00
Thomas Steinacher
94df88ca7c Adapting gevent_websocket.py sample for websocket protocol 076. 2010-07-09 00:31:12 +08:00
Paul J. Davis
3ad7c1b395 Make WSGI app names are now evaled in the module namespace.
This allows people to pass info from the command line to a WSGI
application. See examples/alt_spec.py for code that uses this
method. Example invocation:

    $ gunicorn 'alt_spec:load("my arg here")'

Notice the single quotes to avoid shell escape semantics.

Closes #56
Closes #40
2010-07-08 00:12:15 -04:00
Paul J. Davis
80f4d17122 Added an example reloader config to the examples.
Thanks to thomasst on GitHub for the sample.

Closes #54
2010-07-07 21:27:43 -04:00
benoitc
ae025cd22b put back websocket support with new http parser 2010-06-03 16:11:18 -04:00
Paul J. Davis
3c7d5320fa Large refactor of the documentation and website. 2010-05-30 14:36:06 -04:00
benoitc
aee54903a6 add memory watch example 2010-05-23 00:45:31 +02:00
Paul J. Davis
6ffbe54734 Added unit tests for new Config code. 2010-05-21 22:54:22 -04:00
Paul J. Davis
0a46d09c6e Avoid a deadlock when the acceptor loop raises.
An out of file descriptors error was causing the async acceptor loops to
die. The notification process was unaffected so the workers didn't die.

Async workers hitting an error in the acceptor now kill themselves and
rely on the arbiter to restart a new worker in their stead.
2010-05-11 23:33:48 -04:00