Skip to content

Commit

Permalink
Update ef-quickdebug.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
johnzheng1975 authored Aug 18, 2022
1 parent 0da2331 commit 48b2c49
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions quick_debug_with_envoyfilter/ef-quickdebug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,36 @@ spec:
listener:
filterChain:
filter:
name: envoy.http_connection_manager
name: envoy.filters.network.http_connection_manager
subFilter:
name: envoy.router
name: envoy.filters.http.router
patch:
operation: INSERT_BEFORE
value:
config:
typed_config:
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua"
inlineCode: |
function envoy_on_request(request_handle)
request_handle:logInfo("******* Enter debug logs - envoy_on_request")
request_handle:logInfo("******* request header")
local headers = request_handle:headers()
for key,value in pairs(headers) do request_handle:logInfo(key.." "..value) end
request_handle:logInfo("******* request body")
for chunk in request_handle:bodyChunks() do
request_handle:logInfo(chunk:getBytes(0,chunk:length()))
end
end
function envoy_on_response(response_handle)
response_handle:logInfo("******* Enter debug logs - envoy_on_response")
response_handle:logInfo("******* response header")
local pheaders = response_handle:headers()
for key,value in pairs(pheaders) do response_handle:logInfo(key.." "..value) end
response_handle:logInfo("******* response body")
for chunk in response_handle:bodyChunks() do
response_handle:logInfo(chunk:getBytes(0,chunk:length()))
end
end
name: envoy.lua

0 comments on commit 48b2c49

Please sign in to comment.