{"id":49315363,"url":"https://github.com/trasherdk/posix-syslog","last_synced_at":"2026-04-26T15:01:29.474Z","repository":{"id":339726711,"uuid":"1163121849","full_name":"trasherdk/posix-syslog","owner":"trasherdk","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-21T07:54:47.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-21T13:52:40.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trasherdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-21T05:56:27.000Z","updated_at":"2026-02-21T07:54:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/trasherdk/posix-syslog","commit_stats":null,"previous_names":["trasherdk/posix-syslog"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/trasherdk/posix-syslog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fposix-syslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fposix-syslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fposix-syslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fposix-syslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trasherdk","download_url":"https://codeload.github.com/trasherdk/posix-syslog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trasherdk%2Fposix-syslog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32301330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"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":[],"created_at":"2026-04-26T15:01:28.809Z","updated_at":"2026-04-26T15:01:29.465Z","avatar_url":"https://github.com/trasherdk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @trasherdk/posix-syslog\n\nPOSIX syslog bindings for Node.js — based on code from [node-posix](https://github.com/ohmu/node-posix).\n- Extracted from a fork [node-posix](https://github.com/ilb/node-posix)\n\nProvides `openlog`, `closelog`, `syslog`, `setlogmask`, and `createLogger` as a native C++ addon using N-API, with full TypeScript types and ESM support.\n\n## Installation\n\n```\nnpm install @trasherdk/posix-syslog\n```\n\n## Usage\n\n```typescript\nimport { openlog, syslog, closelog } from \"@trasherdk/posix-syslog\";\n\nopenlog(\"myprog\", { pid: true, ndelay: true }, \"local7\");\nsyslog(\"info\", \"hello, world!\");\ncloselog();\n```\n\n### Multiple facilities\n\nUse `createLogger()` to direct messages to different syslog facilities\nwithin the same process. Call `openlog()` once to set identity and options,\nthen create loggers for each facility:\n\n```typescript\nimport { openlog, createLogger, closelog } from \"@trasherdk/posix-syslog\";\n\nopenlog(\"myapp\", { pid: true, ndelay: true }, \"user\");\n\nconst auth = createLogger(\"auth\");\nconst app  = createLogger(\"local0\");\n\nauth.info(\"login successful\");\napp.warning(\"disk usage high\");\napp.debug(\"processing request #42\");\n\ncloselog();\n```\n\n## API\n\n### openlog(identity, options, facility)\n\nOpen a connection to the logger.\n\n- `identity` — name of the process visible in logged entries.\n- `options` — object with boolean flags:\n  - `cons` — Log to the system console on error.\n  - `ndelay` — Connect to syslog daemon immediately.\n  - `nowait` — Do not wait for child processes.\n  - `odelay` — Delay open until syslog() is called.\n  - `pid` — Log the process ID with each message.\n- `facility` — facility code string:\n  `kern`, `user`, `mail`, `news`, `uucp`, `daemon`, `auth`, `authpriv`, `cron`, `ftp`, `lpr`, `syslog`, `local0`..`local7`\n\nOnly `user` and `local0`..`local7` are defined in the POSIX standard.\n\n### closelog()\n\nClose connection to the logger.\n\n### setlogmask(mask)\n\nSets a priority mask for log messages. Further `syslog()` calls are only sent if their priority is included in the mask. Returns an object with boolean flags indicating which priorities were previously enabled.\n\n```typescript\nsetlogmask({ emerg: true, alert: true, crit: true });\n```\n\n### syslog(priority, message)\n\nSend a message to the syslog logger.\n\nPriorities: `emerg`, `alert`, `crit`, `err`, `warning`, `notice`, `info`, `debug`\n\n```typescript\nsyslog(\"info\", \"hello, world!\");\n```\n\n### createLogger(facility)\n\nCreate a logger bound to a specific facility. The facility is OR'd into the\npriority on each call, overriding the default set by `openlog()`.\n\nReturns an object with a method for each priority level:\n`emerg`, `alert`, `crit`, `err`, `warning`, `notice`, `info`, `debug`\n\n```typescript\nconst log = createLogger(\"auth\");\nlog.info(\"user logged in\");\n```\n\n## TypeScript\n\nAll exports are fully typed. Key types:\n\n```typescript\nimport type {\n  SyslogPriority, SyslogFacility, SyslogOptions, SyslogMask, Logger,\n} from \"@trasherdk/posix-syslog\";\n```\n\n## License\n\nMIT — Copyright (c) 2011-2015 Mika Eloranta\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrasherdk%2Fposix-syslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrasherdk%2Fposix-syslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrasherdk%2Fposix-syslog/lists"}