Ticket #257 (defect)
Opened 3 years ago
Last modified 3 years ago
Make separate error.log and access.log
Status: closed (fixed)
| Reported by: | fumanchu | Assigned to: | fumanchu |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1 |
| Component: | CherryPy code | Keywords: | log |
| Cc: |
The access.log should use the Common Log Format (see http://httpd.apache.org/docs/1.3/logs.html#common). The screen might output both in a mixed log if logToScreen is True.
Change History
08/10/05 14:35:59: Modified by speno
08/10/05 18:52:31: Modified by fumanchu
Stage 1 complete: you can now get an access log (in Common Log Format) by setting "server.logAccessFile" to some writable filename. The old log has not changed; stage 2 will probably be to remove access messages from the old log file, and only use it for errors/config.
Screen output (if enabled) includes messages for both logs, just mixing them as they arise.
The only major bummer is that I violated the CLF spec a bit--if there's no "Content-Length" header (as in a pure HTTP/1.1 conversation when content is yielded from a page handler), then there's no number of bytes in the response body. I had the logger output "-" in that case, which actually signifies no body. The alternative seemed worse (violating Peter Hunt's nice isolated WSGIServer by making it write to CP's log).
08/10/05 18:53:58: Modified by fumanchu
Stage 1 is in changeset [527] by the way.
08/26/05 19:04:30: Modified by fumanchu
- status changed from new to closed.
- resolution set to fixed.
Fixed in changeset [559]. Access messages are only printed to the error.log if there is no access.log file defined. The code has been commented for removal in CP 2.2.


And it might be nice to use python's logging module somehow for this.