Sounds like log buffering of some kind, could be that a continues open link is buffered until it is closed before it is written to the logs, which sounds logical as nginx does not yet know how much data has been send in order to complete the logging.
It should be possible to capture the request in Lua and log that separately.
It should be possible to capture the request in Lua and log that separately.