Skip to content

gh-96339: Support address=None in SysLogHandler to use the syslog module#154548

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:syslog-handler-local
Open

gh-96339: Support address=None in SysLogHandler to use the syslog module#154548
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:syslog-handler-local

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

SysLogHandler now accepts address=None to log to the local system logger via the syslog module. This works even where there is no syslog socket, such as on recent versions of macOS (see #91070).

This follows the design agreed in the discussion: rather than a new handler class, address=None selects the native syslog API. The existing encodePriority() already produces the value syslog.syslog() expects, and the handler's ident remains a message prefix, so no process-global openlog() is needed.

🤖 Generated with Claude Code

…og module

SysLogHandler now logs to the local system logger via the syslog module when
the address is None.  This works even where there is no syslog socket, such as
on recent versions of macOS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33728627 | 📁 Comparing 44626e9 against main (0ca0107)

  🔍 Preview build  

3 files changed
± library/logging.handlers.html
± whatsnew/3.16.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant