Conversation
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.
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SysLogHandlerrecipe 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
HTTPHandlercaveat 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:
<14>prefix, absence of a NUL suffix, and resource cleanup.pytest: 218 passed.black --check --diff src tests,pylint src,mypy src tests, andvalidate-pyproject pyproject.toml: passed.Documentation tooling note:
mkdocstrings-python2.0.8 rejects the existingimportconfiguration on unchangedmaintoo. 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.