{"id":23148526,"url":"https://github.com/g41797/syslog","last_synced_at":"2026-02-11T11:04:08.504Z","repository":{"id":266237823,"uuid":"869022631","full_name":"g41797/syslog","owner":"g41797","description":"Zig syslog client","archived":false,"fork":false,"pushed_at":"2025-12-19T19:00:35.000Z","size":436,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T07:53:46.317Z","etag":null,"topics":["rfc5424","syslog","syslog-client","tcp","udp","zig","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/g41797.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-07T15:30:47.000Z","updated_at":"2025-12-19T19:00:39.000Z","dependencies_parsed_at":"2025-08-17T17:34:20.866Z","dependency_job_id":"3e19b91b-c428-491e-8ace-8b7a3e865219","html_url":"https://github.com/g41797/syslog","commit_stats":null,"previous_names":["g41797/syslog"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/g41797/syslog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g41797%2Fsyslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g41797%2Fsyslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g41797%2Fsyslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g41797%2Fsyslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g41797","download_url":"https://codeload.github.com/g41797/syslog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g41797%2Fsyslog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29332292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rfc5424","syslog","syslog-client","tcp","udp","zig","zig-library","zig-package"],"created_at":"2024-12-17T17:11:58.929Z","updated_at":"2026-02-11T11:04:08.498Z","avatar_url":"https://github.com/g41797.png","language":"Zig","readme":"![](_logo/syslogzig-removebg.png)\n\n# \u003ccenter\u003eZig syslog client\u003c/center\u003e\n\n\u003ccenter\u003e\n\n[![CI](https://github.com/g41797/syslog/actions/workflows/ci.yml/badge.svg)](https://github.com/g41797/syslog/actions/workflows/ci.yml)[![Wiki](https://img.shields.io/badge/Wikipedia-%23000000.svg?style=for-the-badge\u0026logo=wikipedia\u0026logoColor=white)](https://en.wikipedia.org/wiki/Syslog)\n\u003cimg src=\"https://img.shields.io/badge/Linux-FCC624?style=flat\u0026logo=linux\u0026logoColor=black\" width=\"48\" height=\"24\"\u003e\u0026nbsp;\n\u003cimg src=\"https://img.shields.io/badge/macOS-000000?style=flat\u0026logo=apple\u0026logoColor=white\" width=\"48\" height=\"24\"\u003e\u0026nbsp;\n\u003cimg src=\"https://img.shields.io/badge/Windows-0078D6?style=flat\u0026logo=windows\u0026logoColor=white\" width=\"48\" height=\"24\"\u003e\u0026nbsp;\n\n\u003c/center\u003e\n\n\n  This is a [syslog](https://en.wikipedia.org/wiki/Syslog) client library for Zig:\n\n|           |                                                                    |\n|-----------|:------------------------------------------------------------------:|\n| Protocols |                              UDP, TCP                              |  \n| RFC       | Subset of [RFC5424](https://datatracker.ietf.org/doc/html/rfc5424) |\n| Tested on |       Mac, Windows, Linux                   |\n  \nFor the curious: [IT Explained:\nSyslog](https://www.paessler.com/it-explained/syslog)  \n  \n\n## Hello, Zig!\n     \nWhen client code calls\n```zig\n    logger.write_info(\"Hello, Zig!\");\n```\n\n[syslog client](src/syslog.zig) sends following text message to syslog receiver process:\n\u003e\n\u003e \u003c190\u003e1 2024-10-09T09:07:11+00:00 BLKF zigprocess 18548 1 - Hello, Zig!\n\u003e \n   \n    \nLet's see what this message consist of:\n   \n| Value | RFC Definition  | Description                                            |\n|:-----------:|:---------------:|:-------------------------------------------------------|\n|   190     |     PRIVAL      | [Priority](#priority)                               |\n|   1     |     VERSION     | Always 1                                               |\n|   2024-10-09T09:07:11+00:00     |    TIMESTAMP    | FULL-DATE \"T\" FULL-TIME                                |\n|   BLKF     |    HOSTNAME     | Hostname or '-'                                        |\n|   zigprocess     |    APP-NAME     | Application name provided by caller                    |\n|   18548     |     PROCID      | Process ID or  '-'                                     |\n|   1     |      MSGID      | Message ID - sequential number generated automatically |\n|   -     | STRUCTURED-DATA | Always '-'                                             |\n|   Hello, Zig!     |       MSG       | Message                                                |\n\n   \n     \n### Priority\n\n\u003e              Priority = Facility * 8 + Severity \n\n**Facility** represents the machine process that created the Syslog event\n\n| rfc5424.Facility      | Value | Description |\n|:----------------------|  :---:           |          :--- |\n| .kern                 | 0  |     kernel messages |\n| .user                 | 1  |     random user-level messages |\n| .mail                 | 2  |     mail system |\n| .daemon               | 3  |     system daemons |\n| .auth                 | 4  |     security/authorization messages |\n| .syslog               | 5  |     messages generated internally by syslogd |\n| .lpr                  | 6  |     line printer subsystem |\n| .news                 | 7  |     network news subsystem |\n| .uucp                 | 8  |     UUCP subsystem |\n| .cron                 | 9  |     clock daemon |\n| .authpriv             | 10 |     security/authorization messages (private) |\n| .ftp                  | 11 |     ftp daemon |\n| .local0               | 16 |     local use 0 |\n| .local1               | 17 |     local use 1 |\n| .local2               | 18 |     local use 2 |\n| .local3               | 19 |     local use 3 |\n| .local4               | 20 |     local use 4 |\n| .local5               | 21 |     local use 5 |\n| .local6               | 22 |     local use 6 |\n| .local7               | 23 |     local use 7 |\n \n     \n  \n**Severity** describes the severity level of the syslog message in question.\n\n| Level | rfc5424.Severity | Description |\n| :---:          |:-----------------|          :--- |\n|0| .emerg           |  system is unusable               |\n|1| .alert           |  action must be taken immediately |\n|2| .crit            |  critical conditions              |\n|3| .err             |  error conditions                 |\n|4| .warning         |  warning conditions               |\n|5| .notice          |  normal but significant condition |\n|6| .info            |  informational                    |\n|7| .debug           |  debug-level messages             |\n\n\n### Quiz\n\nWhat are *Facility* and *Severity* of **\"Hello, Zig!\"** message?\n\n### For leisure time\n\n- [What is Syslog?](https://www.auvik.com/franklyit/blog/what-is-syslog/)\n- [syslog-ng Open Source Edition](https://www.syslog-ng.com/products/open-source-log-management/)\n- [The rocket-fast system for log processing](https://www.rsyslog.com/)\n- [Old brave syslogd](https://linux.die.net/man/8/syslogd)\n- [Kafka syslog connector](https://www.confluent.io/hub/confluentinc/kafka-connect-syslog)\n- [Nats syslog connector](https://github.com/g41797/syslog2nats)\n\n## Installation\n\nAdd *syslog* to build.zig.zon:\n```bach\nzig fetch --save=syslog git+https://github.com/g41797/syslog\n```\n\nAdd *syslog* to build.zig:\n```zig\n    const syslog = b.dependency(\"syslog\", .{\n        .target = target,\n        .optimize = optimize,\n    });\n\n    const lib = b.addStaticLibrary(..);\n    lib.root_module.addImport(\"syslog\", syslog.module(\"syslog\"));\n\n    const lib_unit_tests = b.addTest(...);\n    lib_unit_tests.root_module.addImport(\"syslog\", syslog.module(\"syslog\"));\n```\n\nImport *syslog*: \n```zig\nconst syslog = @import(\"syslog\");\n```\n\n## Usage\n\n### Configuration\n\nsyslog uses following configuration:\n```zig\npub const SyslogOpts = struct {\n    // application:\n    name: []const u8 = \"zigprocess\",\n    fcl: rfc5424.Facility = .local7,\n\n    // transport:\n    proto: Protocol = .udp,\n    addr: []const u8 = \"127.0.0.1\",\n    port: u16 = 514,\n};\n```\n\n### Initialization\n\n```zig\n    var logger: syslog.Syslog = .{};\n    try logger.init(std.testing.allocator, .{\n        .name = \"runner\",\n        .fcl = .daemon\n        .port = 12345,\n    });\n    defer logger.deinit();\n```\n\nAfter initialization you can call syslog on different threads.\n\n### Logging  \nThere are two groups of APIs:\n- write: message is straight text \n```zig\n    pub inline fn write_\u003cseverity\u003e(slog: *Syslog, msg: []const u8) !void {...}\n    ....\n    logger.write_debug(\"Hello, Zig!\");\n```\n- print: message will be formatted before send\n```zig\n    pub inline fn print_\u003cseverity\u003e(slog: *Syslog, comptime fmt: []const u8, msg: anytype) !void {...}\n    ....\n    const name = \"World\";\n    logger.print_debug(\"Hello, {s}!\", .{name});\n```\n\n### Filtering\n\nSet filter:\n```zig\n    // disable send messages with .info \u0026 .debug severities\n    logger.setfilter(.info);// disable send messages with .info \u0026 .debug severities \n```\n\nReset filter:\n```zig\n    logger.setfilter(null); \n```\n\n## AI Usage\n\nThe following refactoring was performed by [Claude Code](https://claude.com/product/claude-code):\n\n* **Explicit Pointer Dereferencing**: Removed \"Automatic pointer dereference\" and replaced it with explicit `ptr.*` syntax.\n* **Explicit Type Declaration**: Removed \"Type Inference\" by adding explicit types to all variable declarations.\n\nRelated configuration files and guidelines are located in the [.claude/rules](.claude/rules) directory.\n\n## License\n[MIT](LICENSE)\n","funding_links":[],"categories":["Language Essentials"],"sub_categories":["Logging Processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg41797%2Fsyslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg41797%2Fsyslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg41797%2Fsyslog/lists"}