HTTPHandler class 初始化参数包含冗余信息
HTTPHandler class initialization parameters consist redundant information
来自HTTPHandler class上的官方文档:
class logging.handlers.HTTPHandler(host, url, method='GET', secure=False, credentials=None, context=None)
Returns a new instance of the HTTPHandler class. The host can be of the form host:port
, should you need to use a specific port number.
没有 url
参数的文档,我不太确定该放什么。
例如,如果我有一个服务器监听 http://localhost:8080
,那么我认为我应该设置:
host='localhost:8080'
url='http://localhost:8080'
但这不会总是多余的信息吗?
否则,我应该将 url
参数设置为什么?
你只需要添加路径,如:
host='localhost:8080'
path='/'
handler = logging.handlers.HTTPHandler(host, path)
来自HTTPHandler class上的官方文档:
class logging.handlers.HTTPHandler(host, url, method='GET', secure=False, credentials=None, context=None)
Returns a new instance of the HTTPHandler class. The host can be of the form
host:port
, should you need to use a specific port number.
没有 url
参数的文档,我不太确定该放什么。
例如,如果我有一个服务器监听 http://localhost:8080
,那么我认为我应该设置:
host='localhost:8080'
url='http://localhost:8080'
但这不会总是多余的信息吗?
否则,我应该将 url
参数设置为什么?
你只需要添加路径,如:
host='localhost:8080'
path='/'
handler = logging.handlers.HTTPHandler(host, path)