robust-syslog-wrap


Namerobust-syslog-wrap JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/talwrii/syslog-wrap
SummaryA tool to wrap commands and forward standard out and stdin to syslog via TCP
upload_time2025-07-08 21:53:53
maintainerNone
docs_urlNone
author@readwithai
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # robust-syslog-wrap
**@readwithai** - [X](https://x.com/readwithai) - [blog](https://readwithai.substack.com/) - [machine-aided reading](https://www.reddit.com/r/machineAidedReading/) - [đź“–](https://readwithai.substack.com/p/what-is-reading-broadly-defined
)[⚡️](https://readwithai.substack.com/s/technical-miscellany)[🖋️](https://readwithai.substack.com/p/note-taking-with-obsidian-much-of)

`robust-syslog-wrap` is a command-line tool that wraps any command, captures its output, and forwards it to a syslog server. It ensures reliable log delivery using TCP, with logs buffered locally if the syslog server is unavailable, and re-sent when possible.

Normally syslog uses UDP - but here we used TCP to ensure reliable delivery.

##  Motivation
It can be natural to use a tool like logger to redirect output to syslog, but this introduces certain unreliabilities in logging. Missing log lines are frustrating, especially when running your own syslog server for a separate process. I got annoyed with logs dropping or loggers crashing—and worse, associated processes not resuming after a logger failure. So, I decided to write a syslog wrapper to ensure that logs are consistently sent to syslog without losing messages or causing unnecessary interruptions.

## Installation
You can install robust-syslog-wrap with pipx for isolation:

```bash
pipx install robust-syslog-wrap

# Usage

You can use robust-syslog-wrap to run a command and send its output to a syslog server. The following options are available:

Command-line options:
--host <host>: The syslog server's hostname or IP address (defaults to localhost).
--port <port>: The syslog server's port (defaults to 514).
--buffer-limit <size>: Set the maximum buffer size for logs in bytes (defaults to 1GB).

Here is an example

```
robust-syslog-wrap --host 192.168.1.100 --port 514 -- /path/to/your/command --arg1 --arg2
```

Which runs the command `/path/to/your/command --arg1 --arg2` and forward output and error to the syslog server at `192.168.1.100` on port 514. If no host or port is specified it connects to localhost.

## Alternatives and Prior Work
The logger command (part of bsdutils) can read from standard input and write to syslog. However, it does not handle scenarios where the syslog process is down or restarting. Many languages also have libraries that support syslog, some with retry capabilities. However, most of the existing solutions I found on GitHub were either underdocumented or didn't offer the reliability I was looking for.

## Caveats
Though this app gracefully handles syslog restarts by buffering messages, it does not deal with the wrapped process dying. This is left to a supervisor, such as systemd, supervisor, or circus, to monitor and restart the wrapped process if necessary.

This software is reviewed vibe coding with tweaks.

## About me
I am **@readwithai**. I create tools for reading, research and agency sometimes using the markdown editor [Obsidian](https://readwithai.substack.com/p/what-exactly-is-obsidian).

I also create a [stream of tools](https://readwithai.substack.com/p/my-productivity-tools) that are related to carrying out my work.

I write about lots of things - including tools like this - on [X](https://x.com/readwithai).
My [blog](https://readwithai.substack.com/) is more about reading and research and agency.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/talwrii/syslog-wrap",
    "name": "robust-syslog-wrap",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "@readwithai",
    "author_email": "talwrii@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d1/49/6d8dfaa5d7bd9f7d50c0d92cff92bf58c24a356251fb438c7a82ffbd7600/robust_syslog_wrap-1.1.1.tar.gz",
    "platform": null,
    "description": "# robust-syslog-wrap\n**@readwithai** - [X](https://x.com/readwithai) - [blog](https://readwithai.substack.com/) - [machine-aided reading](https://www.reddit.com/r/machineAidedReading/) - [\ud83d\udcd6](https://readwithai.substack.com/p/what-is-reading-broadly-defined\n)[\u26a1\ufe0f](https://readwithai.substack.com/s/technical-miscellany)[\ud83d\udd8b\ufe0f](https://readwithai.substack.com/p/note-taking-with-obsidian-much-of)\n\n`robust-syslog-wrap` is a command-line tool that wraps any command, captures its output, and forwards it to a syslog server. It ensures reliable log delivery using TCP, with logs buffered locally if the syslog server is unavailable, and re-sent when possible.\n\nNormally syslog uses UDP - but here we used TCP to ensure reliable delivery.\n\n##  Motivation\nIt can be natural to use a tool like logger to redirect output to syslog, but this introduces certain unreliabilities in logging. Missing log lines are frustrating, especially when running your own syslog server for a separate process. I got annoyed with logs dropping or loggers crashing\u2014and worse, associated processes not resuming after a logger failure. So, I decided to write a syslog wrapper to ensure that logs are consistently sent to syslog without losing messages or causing unnecessary interruptions.\n\n## Installation\nYou can install robust-syslog-wrap with pipx for isolation:\n\n```bash\npipx install robust-syslog-wrap\n\n# Usage\n\nYou can use robust-syslog-wrap to run a command and send its output to a syslog server. The following options are available:\n\nCommand-line options:\n--host <host>: The syslog server's hostname or IP address (defaults to localhost).\n--port <port>: The syslog server's port (defaults to 514).\n--buffer-limit <size>: Set the maximum buffer size for logs in bytes (defaults to 1GB).\n\nHere is an example\n\n```\nrobust-syslog-wrap --host 192.168.1.100 --port 514 -- /path/to/your/command --arg1 --arg2\n```\n\nWhich runs the command `/path/to/your/command --arg1 --arg2` and forward output and error to the syslog server at `192.168.1.100` on port 514. If no host or port is specified it connects to localhost.\n\n## Alternatives and Prior Work\nThe logger command (part of bsdutils) can read from standard input and write to syslog. However, it does not handle scenarios where the syslog process is down or restarting. Many languages also have libraries that support syslog, some with retry capabilities. However, most of the existing solutions I found on GitHub were either underdocumented or didn't offer the reliability I was looking for.\n\n## Caveats\nThough this app gracefully handles syslog restarts by buffering messages, it does not deal with the wrapped process dying. This is left to a supervisor, such as systemd, supervisor, or circus, to monitor and restart the wrapped process if necessary.\n\nThis software is reviewed vibe coding with tweaks.\n\n## About me\nI am **@readwithai**. I create tools for reading, research and agency sometimes using the markdown editor [Obsidian](https://readwithai.substack.com/p/what-exactly-is-obsidian).\n\nI also create a [stream of tools](https://readwithai.substack.com/p/my-productivity-tools) that are related to carrying out my work.\n\nI write about lots of things - including tools like this - on [X](https://x.com/readwithai).\nMy [blog](https://readwithai.substack.com/) is more about reading and research and agency.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A tool to wrap commands and forward standard out and stdin to syslog via TCP",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/talwrii/syslog-wrap"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d1496d8dfaa5d7bd9f7d50c0d92cff92bf58c24a356251fb438c7a82ffbd7600",
                "md5": "638498e20fccdafa3aa07450e4dc5c2b",
                "sha256": "2eecbe057519a070f40b7e33489766f858d762cad7dd53f73b440565e3d8d170"
            },
            "downloads": -1,
            "filename": "robust_syslog_wrap-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "638498e20fccdafa3aa07450e4dc5c2b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7021,
            "upload_time": "2025-07-08T21:53:53",
            "upload_time_iso_8601": "2025-07-08T21:53:53.647237Z",
            "url": "https://files.pythonhosted.org/packages/d1/49/6d8dfaa5d7bd9f7d50c0d92cff92bf58c24a356251fb438c7a82ffbd7600/robust_syslog_wrap-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 21:53:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "talwrii",
    "github_project": "syslog-wrap",
    "github_not_found": true,
    "lcname": "robust-syslog-wrap"
}
        
Elapsed time: 1.65769s