如何定制Nginx的Log输出格式
set $currentDate 'day';
access_by_lua '
ngx.var.currentDate = os.date("%Y-%m-%d")
';
access_log /logs/app.access.$currentDate.log app_log;
图片:yuanzhang.png
一个很棒的库
https://github.com/cloudflare/lua-resty-logger-socket