-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bug: log-rotate #10795
Comments
Would you be able to respond in English, please . |
Hi @Jasonbr , the log is alright, can you please give specific details for the issue? |
@sheharyaar And then some custom plugins through regularization all became invalid,It seems that it needs to be opened under Plugins: |
This seems unreasonable |
the same problem. my config.yaml everything is ok ,only add
open-connect is not work,version on docker: apache/apisix:3.7.0-debian |
Ok, I will have a look into this issue. |
@Jasonbr @season886 , it would be helpful if you can provide me with route, upstream and relevant configs to test. |
apisix config.yaml:
|
route :
|
upstream:
|
@sheharyaar allow_admin: # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow admin_key: enable_control: true etcd: plugin_attr: plugins: #nacos zhe route, upstream { |
@season886 @Jasonbr ,can you try to enable log-rotate in the config-default.yml with the options and also can you set the log level to |
@sheharyaar here is logfile, "enable log-rotate in the config-default.yml and set log level to info"
|
@sheharyaar , I have found something wrong with log-rotate plugin , when I enable plugin log-rotate in apisix/config.yaml , then I do
I disable plugin log-rotate , then try again , it works normal.
test version under : apache/apisix:3.8.0-debian I will try to find out why . |
I find root cause, If config.yaml not define plugins, then it use alternate config-default.yaml, so most plugins works , because them enable in config-default.yaml. plugin.lua
here load config-default.yaml So if config.yaml enable plugins, then only enable these plugins, the reset plugins were disabled. |
@Jasonbr @season886 , I suggest you try to enable plugin log-rotate in config-default.yaml . |
If this fixed, please close this issue @Jasonbr @season886 |
@hanqingwu 谢谢你的帮助,由于apisix很多都是镜像部署的,手动去修改config-default.yaml不是很方便,建议推送一个pr去修复,目前只能临时进入镜像修改作为过渡 |
@season886 , 你可以手动修改一份,然后挂载进去 docker -v , |
@hanqingwu 试过了,我手动修改的config-default把log-rotate打开了,目前可以正常日志轮询并压缩。open-connect也正常了 |
@season886 if this is fixed, can we close the issue? |
@sheharyaar @hanqingwu Thank you , it's ok! |
Is there anyone who can fix this bug ? |
Copy the plugins field in config-default.yaml to config.yaml, and it works |
Current Behavior
在config.yaml中开启log-rotate插件后其他插件都默认开启的插件都失效了,也需要在plugins下开启。
plugins:
# the plugins you enabled
- log-rotate
plugin_attr:
log-rotate:
interval: 3600 # rotate interval (unit: second)
max_kept: 168 # max number of log files will be kept
max_size: -1 # max size of log files will be kept
enable_compression: false # enable log file compression(gzip) or not, default false
Expected Behavior
开启 - log-rotate的时候不影响其他默认开启的插件。
Error Logs
024/01/10 07:26:22 [warn] 58#58: 13 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 55#55: 2 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 61#61: 16 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 53#53: 11 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 56#56: 3 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 47#47: 12 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 48#48: 7 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 52#52: 9 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 51#51: 5 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 62#62: 15 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 59#59: 14 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 50#50: 4 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 49#49: 6 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 57#57: 1 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 60#60: 17 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 49#49: 6 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 52#52: 9 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 56#56: 3 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 60#60: 17 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 59#59: 14 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 61#61: 16 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 50#50: 4 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 57#57: 1 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 55#55: 2 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 47#47: 12 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 53#53: 11 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 51#51: 5 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 48#48: 7 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 62#62: 15 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 58#58: 13 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 63#63: 8 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 63#63: 8 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 54#54: 10 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 54#54: 10 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
Steps to Reproduce
1、通过docker-compose部署
2、在config.yaml中开启log-rotate插件
plugins:
# the plugins you enabled
- log-rotate
plugin_attr:
log-rotate:
interval: 3600 # rotate interval (unit: second)
max_kept: 168 # max number of log files will be kept
max_size: -1 # max size of log files will be kept
enable_compression: false # enable log file compression(gzip) or not, default false
3、然后通过正则的一些插件就失效了。
Environment
APISIX version (run
apisix version
):2.15.1-alpine
Operating system (run
uname -a
):Linux YS-YS-0026 4.15.0-193-generic feature: opentracing, support Zipkin first #204-Ubuntu SMP Fri Aug 26 19:20:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
OpenResty / Nginx version (run
openresty -V
ornginx -V
):nginx version: openresty/1.21.4.1
built with OpenSSL 1.1.1n 15 Mar 2022
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.21 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.11 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-stream --with-http_ssl_module
curl http://127.0.0.1:9090/v1/server_info
):etcd:3.4.15
APISIX Dashboard version, if relevant:
apisix-dashboard:2.13-alpine
Plugin runner version, for issues related to plugin runners:
log-rotate
LuaRocks version, for installation issues (run
luarocks --version
):/usr/local/bin/luarocks 3.8.0
LuaRocks main command-line interface
The text was updated successfully, but these errors were encountered: