Skip to content

Commit

Permalink
tests(dynamic_log_level): add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Oct 13, 2023
1 parent 8747b1a commit a3044d4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions t/008-log.t
Original file line number Diff line number Diff line change
Expand Up @@ -938,3 +938,28 @@ GET /test
]
--- no_log eval
"you can't see me init_worker"


=== TEST 25: debug log level for nginx error.log
--- http_config
lua_package_path "../lua-resty-core/lib/?.lua;lualib/?.lua;;";
--- config
location = /test_nginx_debug_log {
error_log logs/error.log crit;
content_by_lua_block {
local log = require("resty.kong.log")
log.set_log_level(ngx.DEBUG, 10)
assert(log.get_log_level(ngx.WARN) == ngx.DEBUG)
ngx.exit(200)
}
}
--- request
GET /test_nginx_debug_log
--- wait: 2
--- error_code: 200
--- error_log eval
[
"http finalize request: 200, "/test_nginx_debug_log?" a:1, c:1",
]

0 comments on commit a3044d4

Please sign in to comment.