Skip to content

bug: [file-logger] two log messages mix-output in one line(两条不同的日志混合在一行输出) #7839

Description

@kizy008

Current Behavior

I added file-logger plugins in global_rules, and I foud that two different log are mixed in one line.
我这里把file-logger插件添加到全局规则,我发现存在部分日志内容会把两个不同的日志消息混合在一行中输出。
I guess is it related to buffer size which is used to cache log message or something else ?
我猜测这个会不会用于缓存日志消息的buffer size或其他东西有关?
My log message is more than 4K bytes for this case.
在这个bug中,我的日志信息都超过了4K字节大小。

Expected Behavior

I expected each log message should be output in sperated line.
我期望每条日志记录应该独立的输出到一行。

Error Logs

no error log, just the behavior.
没有错误日志, 只是看到了错误现象。

Steps to Reproduce

It happens accidently, and appears 1/1000 in my environment.
这是个偶发现象, 在我的环境中出现概率约为千分之一。

Environment

  • APISIX version 2.15.0:
    apisix is run in docker with image [apache/apisix:2.15.0-centos]

  • Operating system (run uname -a):
    Linux gateway-web-2-15-0-86687b9f68-xzhdc 4.14.105-19-0024 change: added doc of how to load plugin. #1 SMP Tue Jun 14 16:39:55 CST 2022 x86_64 x86_64 x86_64 GNU/Linux
    apisix is run in docker with image [apache/apisix:2.15.0-centos]

  • OpenResty / Nginx version (run openresty -V or nginx -V):
    nginx version: openresty/1.21.4.1

  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
    {"version":"2.15.0","etcd_version":"3.4.0","id":"2a887545-0b32-4060-bd5d-5db1057b9db2","boot_time":1661732855,"hostname":"gateway-web-2-15-0-86687b9f68-xzhdc"}

  • APISIX Dashboard version, if relevant:
    v2.13.0

  • Plugin runner version, for issues related to plugin runners:
    matched to apisix v2.15.0

  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions