I am building a custom plugin where in I am facing an issue during the database operation like insert, delete, select etc., as well as in tcp connection when it is invoked through :log(), header_filter, body_filter(). Below is the the error message.
[error] 6634#0: 67 failed to run log_by_lua: /usr/local/share/lua/5.1/kong/globalpatches.lua:321: API disabled in the context of log_by_lua*
[C]: in function 'old_tcp’
/usr/local/share/lua/5.1/kong/globalpatches.lua:321: in function ‘tcp’
/usr/local/share/lua/5.1/kong/plugins/ethercis/access.lua:54: in function ‘login_ethercis’
/usr/local/share/lua/5.1/kong/plugins/ethercis/handler.lua:22: in function ‘log’
/usr/local/share/lua/5.1/kong/init.lua:529: in function ‘log’
log_by_lua(nginx-kong.conf:124):2: in function <log_by_lua(nginx-kong.conf:124):1> while logging request, client: 127.0.0.1, server: kong, req
anyone please give some alternative implementation to perform database action only in log() or header_filter() or body_filter modules in a plugin.
Thank you in advance.