{"id":13487436,"url":"https://github.com/eggjs/egg-logger","last_synced_at":"2025-10-14T14:17:39.919Z","repository":{"id":10030689,"uuid":"61421530","full_name":"eggjs/egg-logger","owner":"eggjs","description":"Egg logger","archived":false,"fork":false,"pushed_at":"2024-12-22T00:36:21.000Z","size":255,"stargazers_count":151,"open_issues_count":2,"forks_count":44,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-10-14T12:24:01.586Z","etag":null,"topics":["egg","egg-logger","logger"],"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/eggjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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,"zenodo":null}},"created_at":"2016-06-18T07:01:56.000Z","updated_at":"2025-03-31T04:22:12.000Z","dependencies_parsed_at":"2024-11-09T20:22:59.673Z","dependency_job_id":"300d5ca9-84d2-4cca-ba19-f749bcb607d5","html_url":"https://github.com/eggjs/egg-logger","commit_stats":{"total_commits":113,"total_committers":25,"mean_commits":4.52,"dds":0.7610619469026548,"last_synced_commit":"adbc0c52cdd46cba263f21e92225c624160efdd1"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/eggjs/egg-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs","download_url":"https://codeload.github.com/eggjs/egg-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger/sbom","scorecard":{"id":368742,"data":{"date":"2025-08-11","repo":{"name":"github.com/eggjs/egg-logger","commit":"5f38776943d6e0b7154e6ec12207a57c79894e87"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"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":"Maintained","score":0,"reason":"0 commit(s) and 1 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":"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":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/eggjs/egg-logger/nodejs.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/eggjs/egg-logger/release.yml/master?enable=pin","Info:   0 out of   2 third-party GitHubAction 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Warn: no topLevel permission defined: .github/workflows/release.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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T12:29:23.737Z","repository_id":10030689,"created_at":"2025-08-18T12:29:23.737Z","updated_at":"2025-08-18T12:29:23.737Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019123,"owners_count":26086679,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["egg","egg-logger","logger"],"created_at":"2024-07-31T18:00:59.263Z","updated_at":"2025-10-14T14:17:39.903Z","avatar_url":"https://github.com/eggjs.png","language":"JavaScript","funding_links":[],"categories":["仓库"],"sub_categories":["[内置插件](https://eggjs.org/zh-cn/basics/plugin.html#%E6%8F%92%E4%BB%B6%E5%88%97%E8%A1%A8)"],"readme":"# egg-logger\n\n[![NPM version][npm-image]][npm-url]\n[![CI](https://github.com/eggjs/egg-logger/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/egg-logger/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/egg-logger.svg?style=flat)](https://nodejs.org/en/download/)\n\n[npm-image]: https://img.shields.io/npm/v/egg-logger.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-logger\n[codecov-image]: https://codecov.io/github/eggjs/egg-logger/coverage.svg?branch=master\n[codecov-url]: https://codecov.io/github/eggjs/egg-logger?branch=master\n[snyk-image]: https://snyk.io/test/npm/egg-logger/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-logger\n[download-image]: https://img.shields.io/npm/dm/egg-logger.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-logger\n\nEgg logger.\n\n![diagram](diagram.png)\n\nIncluding two base class, `Logger` and `Transport`:\n\n- Transport: Save log to file, stdout/stderr and network.\n- Logger: A logger can contains multi transports.\n\n---\n\n## Install\n\n```bash\n$ npm i egg-logger\n```\n\n## Usage\n\nCreate a `Logger` and add a file `Transport`.\n\n```js\nconst Logger = require('egg-logger').Logger;\nconst FileTransport = require('egg-logger').FileTransport;\nconst ConsoleTransport = require('egg-logger').ConsoleTransport;\n\nconst logger = new Logger();\nlogger.set('file', new FileTransport({\n  file: '/path/to/file',\n  level: 'INFO',\n}));\nlogger.set('console', new ConsoleTransport({\n  level: 'DEBUG',\n}));\nlogger.debug('debug foo'); // only output to stdout\nlogger.info('info foo');\nlogger.warn('warn foo');\nlogger.error(new Error('error foo'));\n```\n\n### Enable / Disable Transport\n\n```js\nlogger.disable('file');\nlogger.info('info'); // output nothing\nlogger.enable('file');\nlogger.info('info'); // output 'info' string\n```\n\n### Duplicate\n\nDuplicate error log to other logger.\n\nAccept an `options.excludes` to special whether excludes some tranports.\n\n```js\nlogger.duplicate('error', errorLogger, { excludes: [ 'console' ]});\nlogger.error(new Error('print to errorLogger')); // will additional call `errorLogger.error`\n```\n\n### Redirect\n\nRedirect special level log to other logger.\n\n```js\noneLogger.redirect('debug', debugLogger); // all debug level logs of `oneLogger` will delegate to debugLogger\n```\n\n### Reload\n\n```js\nlogger.reload(); // will close the exists write stream and create a new one.\n```\n\n### Custom Transport\n\nYou can make your own `Transport` for logging，e.g.: send log to your logging server.\n\n```js\nconst urllib = require('urllib');\nconst Transport = require('egg-logger').Transport;\n\nclass UrllibTransport extends Transport {\n\n  log(level, args, meta) {\n    const msg = super.log(level, args, meta);\n    return urllib.request('url?msg=' + msg);\n  }\n}\n\nconst logger = new Logger();\nlogger.set('remote', new UrllibTransport({\n  level: 'DEBUG',\n}));\nlogger.info('info');\n```\n\n## Console logger level\n\nset environment NODE_CONSOLE_LOGGRE_LEVEL = 'INFO' | 'WARN' | 'ERROR'\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=eggjs/egg-logger)](https://github.com/eggjs/egg-logger/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs%2Fegg-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-logger/lists"}