Diff

mod_log_http/mod_log_http.lua @ 4317:456b9f608fcf

mod_log_http: Switch to line buffering (thanks Zash+Ge0rG)
author Matthew Wild <mwild1@gmail.com>
date Tue, 05 Jan 2021 13:49:50 +0000
parent 2705:3f44abfe7264
child 4977:3bd725430f40
line wrap: on
line diff
--- a/mod_log_http/mod_log_http.lua	Sat Jan 02 15:38:15 2021 +0100
+++ b/mod_log_http/mod_log_http.lua	Tue Jan 05 13:49:50 2021 +0000
@@ -1,10 +1,11 @@
-module:set_global();
+Addmodule:set_global();
 
 local http = require "net.http";
 local codes = require "net.http.codes";
 local json = require "util.json";
 
 local log = assert(io.open(assert(module:get_option_string("log_http_file"), "Please supply log_http_file in the config"), "a+"));
+log:setvbuf("line");
 
 local function append_request(id, req)
 	local headers = {};