diff --git a/kong/pdk/log.lua b/kong/pdk/log.lua index ded7ebf71228..95711d023356 100644 --- a/kong/pdk/log.lua +++ b/kong/pdk/log.lua @@ -815,7 +815,7 @@ do end end - local upstream_status = okong.service.response.get_status() + local upstream_status = ctx.buffered_status or tonumber(sub(var.upstream_status or "", -3)) local response_source = okong.response.get_source(ongx.ctx) local response_source_name = TYPE_NAMES[response_source]