{"id":26442508,"url":"https://github.com/alt-javascript/logger","last_synced_at":"2026-03-10T08:05:28.810Z","repository":{"id":57096840,"uuid":"385030797","full_name":"alt-javascript/logger","owner":"alt-javascript","description":"A simple configurable logging facade for javascript, using the popular config package interface.","archived":false,"fork":false,"pushed_at":"2022-03-23T07:45:11.000Z","size":674,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T22:29:27.096Z","etag":null,"topics":["javascript","logger","logging","logging-library","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/alt-javascript.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-11T19:00:54.000Z","updated_at":"2023-03-26T10:43:40.000Z","dependencies_parsed_at":"2022-08-20T18:10:14.022Z","dependency_job_id":null,"html_url":"https://github.com/alt-javascript/logger","commit_stats":null,"previous_names":["craigparra/alt-logger"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/alt-javascript/logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alt-javascript%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alt-javascript%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alt-javascript%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alt-javascript%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alt-javascript","download_url":"https://codeload.github.com/alt-javascript/logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alt-javascript%2Flogger/sbom","scorecard":{"id":186999,"data":{"date":"2025-08-11","repo":{"name":"github.com/alt-javascript/logger","commit":"56eae4af378f209c93a168105de59e04b07528b1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/alt-javascript/logger/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/alt-javascript/logger/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/alt-javascript/logger/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/alt-javascript/logger/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/alt-javascript/logger/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/alt-javascript/logger/npm-publish.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   3 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"65 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-86wf-436m-h424","Warn: Project is vulnerable to: GHSA-8w57-jfpm-945m","Warn: Project is vulnerable to: GHSA-8g7p-74h8-hg48","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-ph34-pc88-72gc","Warn: Project is vulnerable to: GHSA-m6cx-g6qm-p2cx","Warn: Project is vulnerable to: GHSA-x8qc-rrcw-4r46","Warn: Project is vulnerable to: GHSA-4328-8hgf-7wjr","Warn: Project is vulnerable to: GHSA-93f3-23rq-pjfp","Warn: Project is vulnerable to: GHSA-pw54-mh39-w3hc","Warn: Project is vulnerable to: GHSA-xgh6-85xh-479p","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-325j-24f4-qv5x","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-x2mc-8fgj-3wmr","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T19:57:55.764Z","repository_id":57096840,"created_at":"2025-08-16T19:57:55.764Z","updated_at":"2025-08-16T19:57:55.764Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30327588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"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":["javascript","logger","logging","logging-library","nodejs"],"created_at":"2025-03-18T10:19:44.930Z","updated_at":"2026-03-10T08:05:28.787Z","avatar_url":"https://github.com/alt-javascript.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"A Simple Log Facade for JavaScript\n===================================\n\n[![NPM](https://nodei.co/npm/@alt-javascript/logger.svg?downloads=true\u0026downloadRank=true)](https://nodei.co/npm/@alt-javascript/logger/)\n\u003cbr/\u003e\n![Language Badge](https://img.shields.io/github/languages/@alt-javascript/logger)\n![Package Badge](https://img.shields.io/npm/v/@alt-javascript/logger) \u003cbr/\u003e\n[release notes](https://github.com/@alt-javascript/logger/blob/main/History.md)\n\n\u003ca name=\"intro\"\u003eIntroduction\u003c/a\u003e\n--------------------------------\nA simple configurable logging facade for JavaScript, using the popular [config](https://www.npmjs.com/package/config)\npackage interface.\n\n\u003ca name=\"usage\"\u003eUsage\u003c/a\u003e\n-------------------------\n\n### Standalone\n\nTo use the module, import the LoggerFactory and call the `getLogger` function with a logging category (your module \nrequires path is a sensible choice).\n\n```javascript\nimport config from 'config';\nimport { LoggerFactory } from '@alt-javascript/logger';\nconst logger = LoggerFactory.getLogger('@myorg/mypackage/MyModule',config);\n\nlogger.info('Hello world!');\n```\nThe LoggerFactory will create a ConsoleLogger (uses `console.log('...')`) object instance, with the root logging level \nset to `info` by default.  To change the logging level for your module (category), add something similar to the\nfollowing in your [config](https://www.npmjs.com/package/config) files.\n\n`local-development.json`\n```json\n{\n  \"logging\" : {\n     \"format\" : 'json',\n     \"level\" : {\n       \"/\" : \"info\",\n       \"@myorg/mypackage/MyModule\" : \"debug\"\n     }\n  }\n}\n```\n\n### @alt-javascript/boot\n\nThe Logger syntax is more fluent if you combine  \n[@alt-javascript/boot](https://www.npmjs.com/package/@alt-javascript/boot) and \n[@alt-javascript/config](https://www.npmjs.com/package/@alt-javascript/config) to bind the LoggerFactory \nto the global root context, freeing your sub-modules from requiring and injecting the config.  \n\n`MyModule.js`\n```javascript\nimport config from '@alt-javascript/config';\nimport { LoggerFactory } from '@alt-javascript/logger';\nimport { boot } from '@alt-javascript/boot';\nboot({config:config});\n\n```\n\nThen in your application modules, you only need.\n\n`MyModule.js`\n```javascript\nimport { LoggerFactory } from '@alt-javascript/logger';\n\nconst logger = LoggerFactory.getLogger('@myorg/mypackage/MyModule');\nlogger.info('Hello from MyModule!')\n```\n### Browser\n\nThe module is also able to be used directly in the browser, in combination with the config module.\nYou can either import the LoggerFactory globally as an IIFE (Immediately Invoked Function Expression),\nas follows:\n\n```html\n   \u003cscript src=\"https://cdn.jsdelivr.net/npm/@alt-javascript/logger/dist/alt-javascript-loggerfactory-iife.js\"\u003e\u003c/script\u003e\n   \u003cscript src=\"https://cdn.jsdelivr.net/npm/@alt-javascript/config/dist/alt-javascript-configfactory-iife.js\"\u003e\u003c/script\u003e\n   \u003cscript\u003e\n       var config = ConfigFactory.getConfig({\n           logging : {\n               format : 'json',\n               level : {\n                   '/' : 'info',\n                   '/MyPage': 'info'\n               }\n           }\n       })\n       var logger = LoggerFactory.getLogger('/MyPage',config);\n       logger.debug('Hello World');\n   \u003c/script\u003e\n```\n\nOr import the ES6 module bundle from a module, as follows:\n\n```javascript\nimport { LoggerFactory } from 'https://cdn.jsdelivr.net/npm/@alt-javascript/logger/dist/alt-javascript-logger-esm.js'\nimport { ConfigFactory } from 'https://cdn.jsdelivr.net/npm/@alt-javascript/logger/dist/alt-javascript-config-esm.js'\n\n//...as above\n```\n\n### Log Levels\n\nThe logger supports the following levels by default, but is fully configurable.\n\n```javascript\n{\n  ENUMS: {\n    fatal: 0, error: 1, warn: 2, info: 3, verbose: 4, debug: 5,\n  },\n  DEBUG: 'debug',\n  VERBOSE: 'verbose',\n  INFO: 'info',\n  WARN: 'warn',\n  ERROR: 'error',\n  FATAL: 'fatal',\n}\n```\n\nYou can test if a level is enabled for your module (category), for example.\n\n```javascript\nif (logger.isDebugEnabled()){\n    logger.debug(`This a performance impacting logline =\u003e ${costlyFunction()}`)\n}\n```\n\u003ca name=\"conf\"\u003eConfiguring\u003c/a\u003e\n------------------------------\n\nWhile the module uses sensible defaults, it is flexible and pluggable.  To use the popular \n[winston](https://www.npmjs.com/package/winston) package you can use a `WinstonLoggerFactory`, passing it your \nwinston and winston options (nullish options will fall back to defaults).\n\n```javascript\nconst config = require('config');\nconst {winston} = require('winston');\nconst {WinstonLoggerFactory} = require('@alt-javascript/logger');\nconst logger = WinstonLoggerFactory.getLogger('@myorg/mypackage/MyModule', config, winston,  {/*mywinstonoptions*/}));\n\nlogger.info('Hello world!');\n```\n\nThe `ConsoleLogger` uses a JSONFormatter, but a PlainTextFormatter (or similar implementation) can easily be\nsubstituted in the config by setting the 'logging.format' config value to 'text'\n\n```json\n{\n  \"logging\" : {\n     \"format\" : 'text',\n     \"level\" : {\n       \"/\" : \"info\",\n       \"@myorg/mypackage/MyModule\" : \"debug\"\n     }\n  }\n}\n```\n\n\u003ca name=\"testing\"\u003eTestability\u003c/a\u003e\n-------------------------\n\nTesting loggers is hard, and testability is a first class concern at @alt-javascript so the module exports a \n'CachingLoggerFactory' that will provide a logger implementation that will capture log lines that can be asserted.\n\n```javascript\nimport config from 'config';\nimport { CachingLoggerFactory } from '@alt-javascript/logger';\nconst logger = CachingLoggerFactory.getLogger('@myorg/mypackage/MyModule', config);\n\nlogger.info('Hello world!');\n\n//...\n\nassert.isTrue(logger.provider.console.cache[0].contains('Hello world!'))\n```\n\n\u003ca name=\"license\"\u003eLicense\u003c/a\u003e\n-----------------------------\n\nMay be freely distributed under the [MIT license](https://raw.githubusercontent.com/alt-javascript/logger/main/LICENSE).\n\nCopyright (c) 2021-2022 Craig Parravicini    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falt-javascript%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falt-javascript%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falt-javascript%2Flogger/lists"}