Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"dgp.filter.http.accesslog" filter can't be used by XDS #519

Open
Zvoid opened this issue Nov 10, 2022 · 0 comments
Open

"dgp.filter.http.accesslog" filter can't be used by XDS #519

Zvoid opened this issue Nov 10, 2022 · 0 comments

Comments

@Zvoid
Copy link

Zvoid commented Nov 10, 2022

My config:
{
"name": "dgp.filter.httpconnectionmanager",
"struct": {
"http_filters": [
{
"name": "dgp.filter.http.directdubboproxy"
},
{
"name": "dgp.filter.http.accesslog",
"config": {
"outPutPath": "C:\aa.log"
}
}
]
}
}
However, "conf" is nil in the access_log filter.
file: access_log.go.
func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain filter.FilterChain) error {
f := &Filter{alw: factory.alw} // Filter.conf is nil
chain.AppendDecodeFilters(f)
chain.AppendEncodeFilters(f)
return nil
}

I modified it. it work.

func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain filter.FilterChain) error {
f := &Filter{
alw: factory.alw,
conf: factory.conf,
}
chain.AppendDecodeFilters(f)
chain.AppendEncodeFilters(f)
return nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant