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
Branches
Tags
No related merge requests found
...@@ -46,7 +46,7 @@ const ( ...@@ -46,7 +46,7 @@ const (
const ( const (
DEFAULT_KEY = "default" DEFAULT_KEY = "default"
PREFIX_DEFAULT_KEY = "default." PREFIX_DEFAULT_KEY = "default."
DEFAULT_SERVICE_FILTERS = "echo,token" DEFAULT_SERVICE_FILTERS = "echo,token,accesslog"
DEFAULT_REFERENCE_FILTERS = "" DEFAULT_REFERENCE_FILTERS = ""
GENERIC_REFERENCE_FILTERS = "generic" GENERIC_REFERENCE_FILTERS = "generic"
GENERIC = "$invoke" GENERIC = "$invoke"
......
...@@ -25,9 +25,6 @@ registries : ...@@ -25,9 +25,6 @@ registries :
username: "" username: ""
password: "" password: ""
# config your filter. for example, you wish to use the access log filter
#filter: "accesslog"
services: services:
"UserProvider": "UserProvider":
# 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册 # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
......
...@@ -48,6 +48,22 @@ func init() { ...@@ -48,6 +48,22 @@ func init() {
extension.SetFilter(constant.ACCESS_LOG_KEY, GetAccessLogFilter) 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 { type AccessLogFilter struct {
logChan chan AccessLogData logChan chan AccessLogData
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment