mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:29:26 +08:00
update
This commit is contained in:
@@ -7,6 +7,7 @@ PRAGMA journal_size_limit = 1073741824;
|
||||
CREATE TABLE IF NOT EXISTS `web_logs` (
|
||||
`time` INTEGER,
|
||||
`ip` TEXT,
|
||||
`scheme` TEXT,
|
||||
`domain` TEXT,
|
||||
`server_name` TEXT,
|
||||
`method` TEXT,
|
||||
|
||||
@@ -542,9 +542,9 @@ function _M.cron(self)
|
||||
|
||||
local stmt_ok, stmt = pcall(function()
|
||||
return db:prepare[[INSERT INTO web_logs(
|
||||
time, ip, domain, server_name, method, status_code, uri, body_length,
|
||||
time, ip, scheme, domain, server_name, method, status_code, uri, body_length,
|
||||
referer, user_agent, protocol, request_time, is_spider, request_headers, ip_list, client_port)
|
||||
VALUES(:time, :ip, :domain, :server_name, :method, :status_code, :uri,
|
||||
VALUES(:time, :ip, :scheme, :domain, :server_name, :method, :status_code, :uri,
|
||||
:body_length, :referer, :user_agent, :protocol, :request_time, :is_spider,
|
||||
:request_headers, :ip_list, :client_port)]]
|
||||
end)
|
||||
@@ -779,6 +779,7 @@ function _M.store_logs_line(self, db, stmt, input_sn, info)
|
||||
stmt:bind_names {
|
||||
time = logline["time"],
|
||||
ip = logline["ip"],
|
||||
scheme = logline["scheme"],
|
||||
domain = logline["domain"],
|
||||
server_name = logline["server_name"],
|
||||
method = logline["method"],
|
||||
|
||||
@@ -200,12 +200,14 @@ local function run_app()
|
||||
local request_uri = ngx.var.request_uri
|
||||
local body_length = C:get_length()
|
||||
local domain = host or "unknown"
|
||||
local http_protocol = ngx.var.scheme or "http"
|
||||
|
||||
local kv = {
|
||||
id = new_id,
|
||||
time_key = os.date("%Y%m%d%H", ngx.time()),
|
||||
time = ngx.time(),
|
||||
ip = ip,
|
||||
scheme = http_protocol,
|
||||
domain = domain,
|
||||
server_name = input_sn,
|
||||
real_server_name = input_sn,
|
||||
|
||||
Reference in New Issue
Block a user