Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Mar 24, 2013
1 parent 692ce1f commit 6c1ec6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion waf.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--发送syslog数据函数
function syslog(msg)
ngx.header.content_type = "text/html"
kern = 0
Expand Down Expand Up @@ -33,6 +34,7 @@ function syslog(msg)

local sock = ngx.socket.udp()
local ok, err = sock:setpeername('127.0.0.1', 514)
--上面的ip和端口就是syslog server的ip和端口地址,可自行修改
if not ok then
ngx.say("failed to connect to syslog server: ", err)
return
Expand All @@ -43,7 +45,7 @@ sign=level+facility*8
ok, err = sock:send('<'..sign..'>'..msg)
sock:close()
end

--日志处理函数
function log(method,url,data)

file=assert(io.open("/data/logs/hack/"..ngx.var.server_name.."_sec.log","a"))
Expand Down

0 comments on commit 6c1ec6b

Please sign in to comment.