Skip to content
Snippets Groups Projects
Commit 2fa5a79d authored by Ming Deng's avatar Ming Deng
Browse files

Add the AccessLogFilter into default filters and add example in comments of acccess_log_filter

parent 17d2a8c6
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ const (
const (
DEFAULT_KEY = "default"
PREFIX_DEFAULT_KEY = "default."
DEFAULT_SERVICE_FILTERS = "echo,token"
DEFAULT_SERVICE_FILTERS = "echo,token,accesslog"
DEFAULT_REFERENCE_FILTERS = ""
GENERIC_REFERENCE_FILTERS = "generic"
GENERIC = "$invoke"
......
......@@ -25,9 +25,6 @@ registries :
username: ""
password: ""
# config your filter. for example, you wish to use the access log filter
#filter: "accesslog"
services:
"UserProvider":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
......
......@@ -48,6 +48,22 @@ func init() {
extension.SetFilter(constant.ACCESS_LOG_KEY, GetAccessLogFilter)
}
/*
* Although the access log filter is a default filter,
* you should config "accesslog" in service's config to tell the filter where store the access log.
* for example:
* "UserProvider":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
registry: "hangzhouzk"
protocol : "dubbo"
# 相当于dubbo.xml中的interface
interface : "com.ikurento.user.UserProvider"
... # other configuration
accesslog: "/your/path/to/store/the/log/", # it should be the path of file.
* the value of "accesslog" can be "true" or "default" too.
* If the value is one of them, the access log will be record in log file which defined in log.yml
*/
type AccessLogFilter struct {
logChan chan AccessLogData
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment