Skip to content

docs: add a runnable syslog integration recipe - #78

Closed
chky1386 wants to merge 1 commit into
nhairs:mainfrom
chky1386:codex/docs-syslog-integration
Closed

chky1386 wants to merge 1 commit into
nhairs:mainfrom
chky1386:codex/docs-syslog-integration

Conversation

@chky1386

@chky1386 chky1386 commented Sep 22, 2026 •

Copy link
Copy Markdown

Refs #42.

The cookbook shows how to format JSON but lacks an example of sending it to a log collection handler. Add a self-contained SysLogHandler recipe with a local UDP receiver and exact expected output, as suggested in #42.

Explain the syslog priority prefix, UTF-8 encoding, NUL terminator, and identifier so readers can configure their collector to parse the JSON payload. Include the standard HTTPHandler caveat from the original issue: attaching a formatter does not change its URL-encoded POST body into JSON. Add an Unreleased changelog entry; no runtime code or version change is needed.

Validation on Python 3.13.11 / macOS arm64:

  • Executed the exact cookbook code block and checked its output, decoded fields, UTF-8, <14> prefix, absence of a NUL suffix, and resource cleanup.
  • pytest: 218 passed.
  • black --check --diff src tests, pylint src, mypy src tests, and validate-pyproject pyproject.toml: passed.
  • Built the documentation and checked the rendered cookbook section.

Documentation tooling note: mkdocstrings-python 2.0.8 rejects the existing import configuration on unchanged main too. The preview was built with 1.19.0. Strict builds report the same seven existing API annotation warnings on both branches; a normal build succeeds. No dependency or configuration changes are included.

Document JsonFormatter with SysLogHandler, local UDP verification, and syslog framing. Explain why HTTPHandler does not use its formatter for a JSON POST body.

Refs nhairs#42.
@nhairs

nhairs commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Thanks for submitting this @chky1386, however I don't think this example is something we'd want to include.

Most of the example implementation is standard logging machinery, which per the docs:

This library assumes that you are famliar with the logging standard library package; if you are not you should start by reading the official Logging HOWTO.

@chky1386 chky1386 closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants