{"id":20809582,"url":"https://github.com/singhs020/koa-mw-logger","last_synced_at":"2026-05-15T21:31:55.362Z","repository":{"id":41820639,"uuid":"229578927","full_name":"singhs020/koa-mw-logger","owner":"singhs020","description":"Koa middleware for logging","archived":false,"fork":false,"pushed_at":"2026-04-11T05:24:50.000Z","size":2598,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-11T07:17:48.219Z","etag":null,"topics":["koa","koa2","logger","logging","middleware"],"latest_commit_sha":null,"homepage":null,"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/singhs020.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-22T14:18:25.000Z","updated_at":"2026-04-11T05:24:52.000Z","dependencies_parsed_at":"2023-02-05T04:15:43.659Z","dependency_job_id":"e17e9587-bcdf-40dd-8f7b-8f462965cca3","html_url":"https://github.com/singhs020/koa-mw-logger","commit_stats":{"total_commits":180,"total_committers":9,"mean_commits":20.0,"dds":0.7388888888888889,"last_synced_commit":"67139ceefe5230fd8a9d8b9cb85ce8aa9b82fda9"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/singhs020/koa-mw-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fkoa-mw-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fkoa-mw-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fkoa-mw-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fkoa-mw-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/singhs020","download_url":"https://codeload.github.com/singhs020/koa-mw-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fkoa-mw-logger/sbom","scorecard":{"id":827071,"data":{"date":"2025-08-11","repo":{"name":"github.com/singhs020/koa-mw-logger","commit":"e2eba6e6922fba7fdfb7a4168691114ca542f874"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","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":"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":"Code-Review","score":0,"reason":"Found 0/10 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npmpublish.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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/singhs020/koa-mw-logger/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/singhs020/koa-mw-logger/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/singhs020/koa-mw-logger/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/singhs020/koa-mw-logger/npmpublish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/npmpublish.yml:23","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 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":"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 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 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"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"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-23T16:49:15.349Z","repository_id":41820639,"created_at":"2025-08-23T16:49:15.350Z","updated_at":"2025-08-23T16:49:15.350Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33080777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["koa","koa2","logger","logging","middleware"],"created_at":"2024-11-17T20:14:47.770Z","updated_at":"2026-05-15T21:31:55.344Z","avatar_url":"https://github.com/singhs020.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-mw-logger\n\n[![NPM](https://nodei.co/npm/koa-mw-logger.png?downloads=true)](https://www.npmjs.com/package/koa-mw-logger/)\n\nKoa middleware for logging\n\n## What it does\n- Every time a request is received, a request id will forwarded or generated and attached to the ctx. It reads the following header keys for re-using the request id: *x-request-id*, *x-amzn-RequestId* and *requestId*.\n- At the completion of the request, it will log the completion of the request with some useful information like request headers, response status code and message, any custom log context attached to it etc.\n- It will also attach a logger instance at the ctx. It can be used to log the objects. Every call to the logging the object will be appended by the request id generated during the start of the request.\n- Appends a function called addCustomLogCtx to add additional info to the final log statement.\n\n## How to use\n```\nconst Koa = require(\"koa\");\nconst getLogger = require(\"koa-mw-logger\");\n\nconst app = Koa();\n\napp.use(getLogger());\n```\n\nto use it in a handler\n```\nasync function handler(ctx, next) {\n  const logger = ctx.logger;\n  logger.info({\"message\": \"logging something\"});\n\n  // to append custom log context to final staetment\n\n  ctx.addCustomLogCtx = {\n    \"foo\": \"bar\"\n  };\n}\n```\n\n## Config\nThere is an option to pass in the config as per the following structure to define some properties of logger.\n\n```\n// config structure\n{\n  \"name\": \"foo\", // name of the logger\n  \"recordIp\": false // whether to extract and record ip from the request object or not. Default value is false.\n  \"recordHeaders\": false // whether to extract and record request headers from the request object or not. Default value is false It will also obfuscate some headers from logging them.\n  \"excludePaths\": [] // strings to match against the path. If the path includes those strings, the log will not be printed.\n}\n\n```\n\n```\nconst Koa = require(\"koa\");\nconst getLogger = require(\"koa-mw-logger\");\n\nconst config = {\n  \"name\": \"test\"\n};\n\nconst app = Koa();\n\napp.use(getLogger(config));\n```\n\n## Graphql Partial Errors\nIf you are using the middleware with a Graphql server implemented using Koa, the partial errors from resolvers are also logged by this middleware. The response in case of the partial error is returned as 200 with errors in the body for a graphql API. The middleware will look for a key `errors` in the response and will log it in `error` object.\n\n## Support or Contact\nHaving trouble with koa-mw-logger or have any questions? Please raise an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinghs020%2Fkoa-mw-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinghs020%2Fkoa-mw-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinghs020%2Fkoa-mw-logger/lists"}