{"id":41419175,"url":"https://github.com/baileyherbert/logging","last_synced_at":"2026-01-23T14:00:14.004Z","repository":{"id":42075760,"uuid":"430235772","full_name":"baileyherbert/logging","owner":"baileyherbert","description":"Just another logging solution for Node.js applications.","archived":false,"fork":false,"pushed_at":"2024-01-21T20:27:06.000Z","size":1280,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-30T00:59:23.565Z","etag":null,"topics":["logging","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/@baileyherbert/logging","language":"TypeScript","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/baileyherbert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-21T00:02:28.000Z","updated_at":"2021-12-30T11:32:19.000Z","dependencies_parsed_at":"2022-08-12T04:10:33.308Z","dependency_job_id":null,"html_url":"https://github.com/baileyherbert/logging","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/baileyherbert/logging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileyherbert%2Flogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileyherbert%2Flogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileyherbert%2Flogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileyherbert%2Flogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baileyherbert","download_url":"https://codeload.github.com/baileyherbert/logging/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baileyherbert%2Flogging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["logging","nodejs"],"created_at":"2026-01-23T14:00:08.009Z","updated_at":"2026-01-23T14:00:13.976Z","avatar_url":"https://github.com/baileyherbert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://bailey.sh/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        \u003cimg width=\"96\" height=\"96\" src=\"https://i.bailey.sh/mA6G3zHDcE.png\" alt=\"Bailey Herbert Logo\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/baileyherbert/logging\" target=\"_blank\" rel=\"noopener noreferrer\"\u003egithub\u003c/a\u003e \u0026nbsp;/\u0026nbsp;\n    \u003ca href=\"https://www.npmjs.com/package/@baileyherbert/logging\" target=\"_blank\" rel=\"noopener noreferrer\"\u003enpm\u003c/a\u003e \u0026nbsp;/\u0026nbsp;\n    \u003ca href=\"https://docs.bailey.sh/logging/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003edocumentation\u003c/a\u003e\n\u003c/p\u003e\n\n# logging\n\nAn elegant logging solution for TypeScript built on a hierarchical composite pattern.\n\n```\nnpm install @baileyherbert/logging\n```\n\n## examples\n\n### creating the root logger\n\nEach application needs at least one root logger instance.\n\n```ts\nconst rootLogger = new Logger();\n```\n\n### attaching transports to the root logger\n\nThe root logger is responsible for piping its output into one or more transports. The example below will create and attach a [console transport](https://docs.bailey.sh/logging/latest/guide/transports/) to the logger, which writes logs directly to the console. This works in a browser environment.\n\n```ts\nrootLogger.createConsoleTransport();\n```\n\n### creating child loggers\n\nEach service in your application should have its own logger instance. These are called child loggers, and they are used to automatically prefix output from services with their names.\n\n```ts\nconst logger = rootLogger.createChild('ServiceName');\n```\n\n### writing logs\n\nLoggers expose methods for each supported severity level.\n\n```ts\nlogger.trace();\nlogger.debug();\nlogger.info();\nlogger.warning();\nlogger.error();\nlogger.critical();\n```\n\nThese methods work identically to `console.log()`. You can pass multiple parameters of any type, and can pass a string for formatting.\n\n```ts\nlogger.info('Logged in as %s from %s', username, ip);\n```\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaileyherbert%2Flogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaileyherbert%2Flogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaileyherbert%2Flogging/lists"}