{"id":42759714,"url":"https://github.com/pengng/http-logs","last_synced_at":"2026-01-29T20:31:33.924Z","repository":{"id":57268243,"uuid":"91240605","full_name":"pengng/http-logs","owner":"pengng","description":"HTTP request log middleware","archived":false,"fork":false,"pushed_at":"2017-08-26T12:35:52.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-03T21:53:30.535Z","etag":null,"topics":["http","log","request"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pengng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-14T12:04:44.000Z","updated_at":"2017-08-26T12:34:02.000Z","dependencies_parsed_at":"2022-09-02T02:50:15.922Z","dependency_job_id":null,"html_url":"https://github.com/pengng/http-logs","commit_stats":null,"previous_names":["pengng/express-req-logger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pengng/http-logs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fhttp-logs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fhttp-logs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fhttp-logs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fhttp-logs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pengng","download_url":"https://codeload.github.com/pengng/http-logs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fhttp-logs/sbom","scorecard":{"id":727086,"data":{"date":"2025-08-11","repo":{"name":"github.com/pengng/http-logs","commit":"710218ebc1c617d316c1cf35f1b2b9b88039bbcf"},"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":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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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/8 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":-1,"reason":"No tokens found","details":null,"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"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"}}]},"last_synced_at":"2025-08-22T13:08:40.465Z","repository_id":57268243,"created_at":"2025-08-22T13:08:40.465Z","updated_at":"2025-08-22T13:08:40.465Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"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":["http","log","request"],"created_at":"2026-01-29T20:31:33.268Z","updated_at":"2026-01-29T20:31:33.910Z","avatar_url":"https://github.com/pengng.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-logs\n\nHTTP request log middleware\n\n### Usage\n\n```bash\nnpm i -S http-logs\n```\n\n```javascript\nconst app = require('express')()\nconst logger = require('http-logs')\napp.use(logger())\napp.listen(3000)\n\n\u003e GET / HTTP/1.1 200 1ms\n```\n\n### config\n\n`logger([preset | token][,options])`\n\n\u003e 第一个参数是一个字符串，可以是[preset](#preset)，也可以是自定义的[token](#token)\n\n#### preset\n\n| preset | output | description |\n| --- | --- | --- |\n| normal | GET / HTTP/1.1 200 218ms | 默认 |\n| tiny | GET / 200 | 简单 |\n| long | [2017-05-14 21:03:25 周日] ::ffff:192.168.0.100 /index.html\u003cbr/\u003eHTTP/1.1 304 23ms Mozilla/5.0 (Windows NT 6.1; Win64;\u003cbr/\u003ex64) AppleWebkit/537.36 (KHTML, like Gecko)\u003cbr/\u003e Chrome/58.0.3029.110 Safari/537.36 | 详细 |\n\n#### token\n\n| token | output | description |\n| --- | --- | --- |\n| method | GET | 请求方法 |\n| url | /path/to/resource | 请求路径 |\n| httpVersion | HTTP/1.1 | http版本 |\n| status | 200 | 响应状态码 |\n| duration | 28ms | 请求到输出完成的持续时间 |\n| ip | ::ffff:192.168.0.100 | IP地址 |\n| date | 2017-05-14 | 请求开始日期 |\n| time | 19:00:00 | 请求开始时间 |\n| day | 周日 | 请求开始星期 |\n| userAgent | Mozilla/5.0 | 客户端用户代理内容 | \n\n```javascript\nconst token = '[:date :time] :method :url :httpVersion :status'\napp.use(logger(token))\n\n// [2017-05-14 19:23:33] GET /index.html HTTP/1.1 200\n```\n\n### options\n\n重定义[token](#token)\n\n```javascript\nconst token = '[:date :when :time] :method :url'\nconst options = {\n  // 增加新的token类型when\n  when: function (req, res) {\n    return (new Date().getHours() \u003e= 12) ? '下午' : '上午'\n  },\n  // 重写method\n  method: function (req, res) {\n    return req.method.toLowerCase()\n  }\n}\napp.use(logger(token, options))\n// [2017-05-14 上午 10:22:29] get /index.html\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengng%2Fhttp-logs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpengng%2Fhttp-logs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengng%2Fhttp-logs/lists"}