Config.lua
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--[[
配置文件
--]]
--[[
rabbitmq服务器
--]]
--rabbitmq_host = '127.0.0.1'
rabbitmq_host = '54.222.219.223'
rabbitmq_port = 5672
rabbitmq_user = 'guest'
rabbitmq_pass = 'guest'
rabbitmq_vhost = '/'
--[[
influxdb服务器
--]]
--influxdb_host = '127.0.0.1'
influxdb_host = '54.222.219.223'
influxdb_port = 8086
--[[
前端监听配置
--]]
http_mq_port = 9503
worker_num = 8
daemonize = false
--[[
日志文件
--]]
--log_file = nil
log_file = '/Data/code/yoho-phplog/access.log'
--[[
通道配置
--]]
--交换机名前缀
rabbitmq_exchange_name = 'yohoExchange_'
--路由键名
rabbitmq_route_key = 'phplog'
--队列名
rabbitmq_queue_name = 'phplog'
--批量ack响应阀值
rabbitmq_ack_interval = 10
info_channel = 'YHInfo'
debug_channel = 'YHDebug'
shutdown_channel = 'YHShutdown'
--[[
执行检测代码
--]]
if log_file then
fp = io.open(log_file,'rb')
if fp ~= nil then
fp:close()
else
dir = string.match(log_file,"(.+)[/\\][^/\\]+")
dp = io.open(dir,'rb')
if dp ~= nil then
dp:close()
else
os.execute('mkdir -p '..dir..' 2>&1 > /dev/null')
end
dp = io.open(dir,'rb')
if dp ~= nil then
dp:close()
fp = io.open(log_file,'w')
if fp ~= nil then
fp:close()
end
end
end
end