HomeServer/examples/main_log.lua
2024-11-20 15:41:37 +08:00

18 lines
382 B
Lua

local skynet = require "skynet"
local harbor = require "skynet.harbor"
require "skynet.manager" -- import skynet.monitor
local function monitor_master()
harbor.linkmaster()
print("master is down")
skynet.exit()
end
skynet.start(function()
print("Log server start")
skynet.monitor "simplemonitor"
local log = skynet.newservice("globallog")
skynet.fork(monitor_master)
end)