main_log.lua 382 B

123456789101112131415161718
  1. local skynet = require "skynet"
  2. local harbor = require "skynet.harbor"
  3. require "skynet.manager" -- import skynet.monitor
  4. local function monitor_master()
  5. harbor.linkmaster()
  6. print("master is down")
  7. skynet.exit()
  8. end
  9. skynet.start(function()
  10. print("Log server start")
  11. skynet.monitor "simplemonitor"
  12. local log = skynet.newservice("globallog")
  13. skynet.fork(monitor_master)
  14. end)