{"id":19874433,"url":"https://github.com/strongloop/modern-syslog","last_synced_at":"2025-04-06T01:10:42.511Z","repository":{"id":57300498,"uuid":"31341245","full_name":"strongloop/modern-syslog","owner":"strongloop","description":"modern-syslog","archived":false,"fork":false,"pushed_at":"2024-05-03T00:21:44.000Z","size":37,"stargazers_count":49,"open_issues_count":6,"forks_count":19,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-30T00:08:08.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strongloop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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}},"created_at":"2015-02-25T23:26:11.000Z","updated_at":"2024-07-26T05:08:56.000Z","dependencies_parsed_at":"2024-06-18T14:06:42.487Z","dependency_job_id":null,"html_url":"https://github.com/strongloop/modern-syslog","commit_stats":{"total_commits":39,"total_committers":5,"mean_commits":7.8,"dds":0.5897435897435898,"last_synced_commit":"d5822e67070187b3ef2e4d7f22f00329891690a1"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongloop%2Fmodern-syslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongloop%2Fmodern-syslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongloop%2Fmodern-syslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongloop%2Fmodern-syslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strongloop","download_url":"https://codeload.github.com/strongloop/modern-syslog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419861,"owners_count":20936012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-12T16:23:18.790Z","updated_at":"2025-04-06T01:10:42.491Z","avatar_url":"https://github.com/strongloop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# modern syslog - streaming, async, native, uses nan\n\nThis is the only syslog library that:\n\n- Uses native bindings to the libc syslog API.\n- Is async, because the libc APIs can block on localhost IPC under load, but\n  that shouldn't block your app.\n- Can be used as a stream.\n- Has formatted log functions.\n- Uses nan, so supports node and io.js, and will continue to do so.\n- Is API compatible with [node-syslog][], from which I gathered inspiration\n  and owe thanks.\n\nDefault mask depends on system.\n\n## Installation\n\n    npm install --save modern-syslog\n\n## API\n\nFor detailed descriptions of the core functions, see [man 3\nsyslog](http://man7.org/linux/man-pages/man3/syslog.3.html).\n\nNote that syslog functions cannot fail, and neither throw errors, nor callback\nwith errors. This is consistent with the core functions, which do not have error\nreturn values.\n\n### log(priority, msg, callback)\n\n- `priority` {String|Number} OR of a level, and optionally, a facility.\n- `msg` {String|Buffer} Message to log.\n- `callback` {Function} Called after message is logged (no arguments).\n\n`priority` can be a String, in which case it will be looked up in\n`syslog.level`. It can also be a Number, in which case it is expected to be\na numeric value, such as `syslog.level.LOG_INFO`, optionally ORed with a\na numeric facility, such as `syslog.facility.LOG_LOCAL2`.\n\nSee below for formatted version of `log()`.\n\n### emerg(fmt, ...)\n### alert(fmt, ...)\n### crit(fmt, ...)\n### error(fmt, ...)\n### err(fmt, ...)\n### warn(fmt, ...)\n### warning(fmt, ...)\n### note(fmt, ...)\n### notice(fmt, ...)\n### info(fmt, ...)\n### debug(fmt, ...)\n\n- `fmt` {String} Arguments are formatted as `msg`, and passed to `log()`.\n\nConvenience functions, log level is pre-defined, facility uses default, either\nsystem default or that provided to `open()`, and message is formatted with\n`util.format()`.\n\n### new Stream(level, [facility])\n\n- `level` {String|Number} Level to log at.\n- `facility` {String|Number} Facility to log with, optional.\n\nReturns a writeable stream that logs all messages at the specified level and\nfacility.\n\n### open(ident, option, facility)\n\n- `ident` {String} Prepended to every message, usually program name.\n- `option` {Number} OR of flags from `syslog.options`.\n- `facility` {String|Number} Default facility to be used by `log()`.\n\nSet up defaults for log.\n\nCalling `open()` is optional, all arguments are provided with defaults, though\nthe defaults depend on the system (see man page).\n\n### close()\n\nClose the socket to the syslog system.\n\nCalling `close()` is optional, the socket is closed automatically by the\nsystem on exit.\n\n### upto(level)\n\n- `level` {String|Number} Level to log up to.\n\nLog all levels upto and including `level`.\n\n### setmask(mask)\n\n- `mask` {Number} OR of levels that should be logged.\n\nNot convenient to use but part of the low-level syslog API. See syslog man page\nfor details, and consider using `upto()` for most common use-cases.\n\n### curmask()\n\nReturns current log mask, see `setmask()`.\n\n### setMask(...)\n\nAvoid this, its for backwards compatibility with [node-syslog][].\n\n### init(...)\n\nAvoid this, its for backwards compatibility with [node-syslog][].\n\n## Properties\n\nSyslog properties are defined as a bi-directional map from String to Number, and\nfrom Number to String, so:\n\n- `syslog.level.LOG_DEBUG`: `7`, the numeric value of `LOG_DEBUG`\n- `syslog.level[7]`: `'LOG_DEBUG'`, string value of level `7`\n\n### syslog.level\n\nLevels are listed from highest priority, to lowest:\n\n- `LOG_EMERG`: System is unusable.\n- `LOG_ALERT`: Action must be taken immediately.\n- `LOG_CRIT`: Critical condition.\n- `LOG_ERR`: Error condition.\n- `LOG_WARNING`: Warning condition.\n- `LOG_NOTICE`: Normal, but significant, condition.\n- `LOG_INFO`: Informational message.\n- `LOG_DEBUG`: Debug-level message.\n\n### syslog.option\n\nObject of properties:\n\n- `LOG_CONS`: Log to console if there is error logging to syslog.\n- `LOG_PERROR`: Log to stderr as well as syslog. (no-op on Solaris)\n- `LOG_PID`: Log process' PID with each message.\n\nThese are unlikely to be useful, but are provided for completeness:\n\n- `LOG_NDELAY`: Open  the  connection  immediately (normally, the connection is\n  opened when the first message is logged).\n- `LOG_ODELAY`: The converse of `LOG_NDELAY`; opening of the connection is\n  delayed until the first message is logged (this is the default and need not be\n  specified).\n- `LOG_NOWAIT`: Archaic option that doesn't do anything on contemporary systems,\n  but is provided for backwards compatibility.\n\n### syslog.facility\n\n- `LOG_AUTH`\n- `LOG_AUTHPRIV` (not defined on all systems)\n- `LOG_CRON`\n- `LOG_DAEMON`\n- `LOG_FTP` (not defined on all systems)\n- `LOG_KERN`\n- `LOG_LOCAL0`\n- `LOG_LOCAL1`\n- `LOG_LOCAL2`\n- `LOG_LOCAL3`\n- `LOG_LOCAL4`\n- `LOG_LOCAL5`\n- `LOG_LOCAL6`\n- `LOG_LOCAL7`\n- `LOG_LPR`\n- `LOG_MAIL`\n- `LOG_NEWS`\n- `LOG_SYSLOG`\n- `LOG_USER`\n- `LOG_UUCP`\n\n[node-syslog]: https://www.npmjs.com/package/node-syslog\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrongloop%2Fmodern-syslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrongloop%2Fmodern-syslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrongloop%2Fmodern-syslog/lists"}