Catch SysLogHandler's output

风格不统一 提交于 2019-12-13 02:23:05

问题


Following advice, I'm planning to log errors from several time critical python processes (clients) to a single logging process (server). SysLogHandler seems to be the correct choice as it uses UDP (I rather be system-agnostic) and does not wait for any confirmation, and as I'm using localhost so there should practically be no loss of logs.

However, I'm unclear as to how I should implement the server side on two accounts:

  • Should I simply open a multiprocessing.connection and conn.recv() the log as text?
  • Is there a way to handle the error as a log on the server side, thus printing it using other logging.handlers? Or is it just plain strings at that point?

A nice use-case would be for the time critical processes to send errors to the logging process which in turn would use SMTPHandler to send these errors via email...


回答1:


Well, to continue with advices ( ;) ), take a look to rsyslog, this is the most powerfull syslog server I know. It support threaded logging facilities, massive load and mail sending.



来源:https://stackoverflow.com/questions/8591567/catch-sysloghandlers-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!