Config.lua 1.57 KB
--[[
        配置文件
--]]


--[[
        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