Commit Graph

14 Commits

Author SHA1 Message Date
Luke Faraone 2be8f80f47 Make request._client a public member, dropping the '_'.
(imported from commit 5fc7ab57157ceb40c8bca9b0c97a47d8fac6745b)
2013-03-28 07:53:36 -07:00
Tim Abbott 6fd4bf38c0 logs: Don't display database time when there were no queries.
(imported from commit 71297c920b63578ebc2770954345bfb9d4d8937f)
2013-03-27 08:19:27 -04:00
Tim Abbott 144987e581 logs: Provide total time passed for longpolled requests.
Also improve display of times passed -- we now use display short times
in milliseconds for easier reading.

(imported from commit 08e1e7e6acbef48453080864946f7602a3395e7c)
2013-03-27 08:19:27 -04:00
Tim Abbott 887389d16c logs: Output timestamps in milliseconds when less than a second.
(imported from commit 150038059a1d7c677004edf27d4af2e48bf41285)
2013-03-27 08:19:27 -04:00
Tim Abbott e080be82fb Add the user's client string to our Django logs.
This should let us distinguish e.g. mobile from API bots.

(imported from commit 192114a0f79bfa7fb918e8c026da63ef772c2449)
2013-03-15 16:37:40 -04:00
Tim Abbott ff099f9291 logging: Fix super verbose logging of 404 errors.
(imported from commit bb2b4f0c3cf37c16d5c634d22b7cc576ee00e5f4)
2013-02-12 16:36:13 -05:00
Tim Abbott 54b10a292c Monkeypatch Django cursor to log query times even when DEBUG=False.
I don't like monkeypatching in general, but this will give us logging
of how much time is being spent in total on database queries on our
staging and prod instances for each of the views we have -- which
should help a lot with debugging performance problems.

The code being patched is identical in Django 1.5, so I don't expect
any issues upgrading in the near future.

I may work on a patch to upstream Django to support this as well.

(imported from commit 08624c7a30f1fd192a972973e0380dd6a131d84e)
2013-02-12 12:01:02 -05:00
Tim Abbott d0953bc8a1 Log time spent doing database queries when DEBUG=True.
When DEBUG=False, Django doesn't log the data at all.  We can and
should add tracking of that at some point, but it requires patching
Django; so for now just log the data when DEBUG=True.

(imported from commit 2b9e6a4c68009733373724f38debe4e77313fdeb)
2013-02-12 11:07:36 -05:00
Tim Abbott c24e05f0e9 Log requestor email address for non-error requests too.
This should make it much easier to debug issues where a particular
user is hosing our API, for example.

(imported from commit cbea49fd1e11805cadf564bd9160d3d6bf7e0eca)
2013-02-12 11:07:36 -05:00
Tim Abbott a3a0880266 middleware: Improve logging of users causing 40x errors.
Previously we only got the user ID for /json requests, not /api
requests, and also only got the user ID, not the email address.

(imported from commit c3625f9c1a48430e35183be6c90a7855f3714948)
2013-02-05 14:36:48 -05:00
Tim Abbott fe100d0047 Log a message with details on any 40x responses.
(imported from commit d1c3cf28ec55cb507f4a0c17168b352323b11d5c)
2013-02-01 14:50:28 -05:00
Zev Benjamin bf5ce4783d Move @has_request_variables error responses to middleware
This will now allow us to use @has_request_variables on helper
functions.

(imported from commit 799d71477654eac7fd8192cfc5bb88b78053532d)
2012-12-20 14:26:36 -05:00
Tim Abbott 7ae73fabd4 Log how long requests take to process.
(imported from commit 89915f859e4493ff04a34d198ac6df5541b743cc)
2012-11-14 15:52:57 -05:00
Keegan McAllister 94f107e281 Log all requests
runserver already prints them to the console, but runfcgi doesn't.

(imported from commit 3450e3fd65ef3990729c94e80dad4fc3c89f0e64)
2012-10-17 18:23:02 -04:00