Skip to content

Is there a way to get the access log programatically? #910

Answered by abhinavsingh
AsafMah asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can get access to the logs programmatically. You need to write a plugin for it. Example, ProxyPoolPlugin utilizes on_access_log hook, see https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/plugin/proxy_pool.py#L198-L212

Also look at formal definition of on_access_log here

def on_access_log(self, context: Dict[str, Any]) -> Optional[Dict[str, Any]]:
"""Use this method to override default access log format (see
DEFAULT_HTTP_ACCESS_LOG_FORMAT and DEFAULT_HTTPS_ACCESS_LOG_FORMAT) and to
add/update/modify/delete context for next plugin.on_access_log invocation.
This is spe…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AsafMah
Comment options

@abhinavsingh
Comment options

@AsafMah
Comment options

@abhinavsingh
Comment options

Answer selected by abhinavsingh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Question Questions related to proxy server
2 participants
Converted from issue

This discussion was converted from issue #909 on December 27, 2021 13:02.