Skip to content

Commit a3044d4

Browse files
committed
tests(dynamic_log_level): add test case
1 parent 8747b1a commit a3044d4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

t/008-log.t

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,3 +938,28 @@ GET /test
938938
]
939939
--- no_log eval
940940
"you can't see me init_worker"
941+
942+
943+
=== TEST 25: debug log level for nginx error.log
944+
--- http_config
945+
lua_package_path "../lua-resty-core/lib/?.lua;lualib/?.lua;;";
946+
--- config
947+
location = /test_nginx_debug_log {
948+
949+
error_log logs/error.log crit;
950+
951+
content_by_lua_block {
952+
local log = require("resty.kong.log")
953+
log.set_log_level(ngx.DEBUG, 10)
954+
assert(log.get_log_level(ngx.WARN) == ngx.DEBUG)
955+
ngx.exit(200)
956+
}
957+
}
958+
--- request
959+
GET /test_nginx_debug_log
960+
--- wait: 2
961+
--- error_code: 200
962+
--- error_log eval
963+
[
964+
"http finalize request: 200, "/test_nginx_debug_log?" a:1, c:1",
965+
]

0 commit comments

Comments
 (0)