8000 Consider adding logging.handlers.LocalSysLogHandler · Issue #96339 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Consider adding logging.handlers.LocalSysLogHandler #96339
@ronaldoussoren

Description

@ronaldoussoren

Feature or enhancement

Add a handler to the logging package that uses syslog.syslog to log

Pitch

As mentioned in #91070 the logging.handlers.SysLogHandler cannot log to the local system log on recent versions of macOS. It is possible to log using syslog.syslog, I've checked that the code below results in a message in the system log:

syslog.syslog(syslog.LOG_WARNING|syslog.LOG_LOCAL7, "message from python")

Because of this it might be useful to define a LocalSysLogHander class that logs locally using the syslog module.

There is a design challenge here though: The syslog module (and libc function) has proces global configuration. This in particular affects the "ident" field which can only be set as proces global configuration. Another challenge is the interaction between the logging package handling of priorities and handling of those in syslog(3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0