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

feat(http-logger): support for specified the log formats via admin API #2309

Merged
merged 2 commits into from
Oct 13, 2020
Merged

feat(http-logger): support for specified the log formats via admin API #2309

merged 2 commits into from
Oct 13, 2020

Conversation

membphis
Copy link
Member

@membphis membphis commented Sep 24, 2020

This reverts commit 13b0968.

What this PR does / why we need it:

as title.

For example:

curl http://****/apisix/admin/plugin_metadata/http-logger -d '
{
    "log_format": {
        "host": "$host",
        "@timestamp": "$time_iso8601",
        "client_ip": "$remote_addr"
    }
}'

when we enabled plugin http-logger, we will get the message body like:

{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}

related PR:

#2307
#2294

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

curl http://****/apisix/admin/plugin_metadata/http-logger -d '
{
    "log_format": {
        "host": "$host",
        "@timestamp": "$time_iso8601",
        "client_ip": "$remote_addr"
    }
}'

when we enabled plugin http-logger, we will get the message body like:

{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
@spacewander spacewander merged commit 5614a95 into apache:master Oct 13, 2020
@membphis membphis deleted the feat-http-logger-log-format branch October 13, 2020 06:37
@moonming moonming added this to the 2.0 milestone Oct 19, 2020
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

Successfully merging this pull request may close these issues.

5 participants