Merged
Conversation
Introduce class AccessLogger. Instance of this class is
constructed by passing log_format, and used to log messages
according to this format.
Sample usage:
log = logging.getLogger("spam")
access_logger = AccessLogger(log, "%a %{User-Agent}i")
access_logger.log(message, environ, response, transport, time)
Use this object in ServerHttpProtocol for logging.
dccd05d to
f157e32
Compare
added 5 commits
October 17, 2015 22:23
The common time format for logs is: [day/month/year:hour:minute:second zone] day = 2*digit month = 3*letter year = 4*digit hour = 2*digit minute = 2*digit second = 2*digit zone = (`+' | `-') 4*digit
To be consitent with apache, %b should contain output body length without headers. Also add %O variable which contain full output length.
Create AccessLogger instance in RequestHandlerFactory constructor. This avoids initializing AccessLogger per each connection.
aiohttp/helpers.py
Outdated
Member
There was a problem hiding this comment.
Use upstr(key) instead of key.upper() call.
added 2 commits
October 21, 2015 23:56
Use cache for faster AccessLogger initialization. Optimize logging process.
Contributor
Author
|
New patch added: Now AccessLogger object is constructed in I can try to move AccessLogger instantiation out of constructor later. |
Member
|
Cool! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce class AccessLogger. Instance of this class is
constructed by passing log_format, and used to log messages
according to this format.
Usage:
Use this object in ServerHttpProtocol for logging.
Also closed #458