Python's SyslogHandler and TCP

吃可爱长大的小学妹 提交于 2019-12-04 11:50:30

Syslog support in logging predates the RFC, and before that RFC, there was little in the way of standards.

To be precise: the SysLogHandler handler was part of logging when first added to the Python standard library in 2002 and has remained largely the same since (TCP support was added in 2009, and RFC5424 support was improved in 2011); the original code was based on this syslog module from 1997.

From other bug reports it is clear the maintainers want to keep the broadest backwards compatibility in code here, so if you need specific functionality from a newer RFC, you have two options:

  • Extend the class and implement that functionality yourself
  • Submit feature requests and / or patches to improve the functionality in the logging module; take into account the backwards-compatibility requirements.

Given that the question is tagged fluentd, have you tried using fluent.handler.FluentHandler in place of logging.handlers.SysLogHandler - see https://github.com/fluent/fluent-logger-python?

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