{"id":45579241,"url":"https://github.com/usrz/js-express-errorlog","last_synced_at":"2026-02-23T11:32:11.229Z","repository":{"id":29595701,"uuid":"33135706","full_name":"usrz/js-express-errorlog","owner":"usrz","description":"A simple error logger for Express 4.x","archived":false,"fork":false,"pushed_at":"2017-02-07T09:44:36.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-09T05:54:37.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/usrz.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":"2015-03-30T16:51:59.000Z","updated_at":"2017-02-07T09:44:38.000Z","dependencies_parsed_at":"2022-09-03T18:20:28.475Z","dependency_job_id":null,"html_url":"https://github.com/usrz/js-express-errorlog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/usrz/js-express-errorlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrz%2Fjs-express-errorlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrz%2Fjs-express-errorlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrz%2Fjs-express-errorlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrz%2Fjs-express-errorlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usrz","download_url":"https://codeload.github.com/usrz/js-express-errorlog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrz%2Fjs-express-errorlog/sbom","scorecard":{"id":912830,"data":{"date":"2025-08-11","repo":{"name":"github.com/usrz/js-express-errorlog","commit":"ce435242a49448bfcd80b6927baa8dfe1cd13dc4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"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":"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":"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":-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":"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":"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":"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":"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":"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":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":"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"}}]},"last_synced_at":"2025-08-24T19:53:00.698Z","repository_id":29595701,"created_at":"2025-08-24T19:53:00.698Z","updated_at":"2025-08-24T19:53:00.698Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"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":[],"created_at":"2026-02-23T11:32:06.068Z","updated_at":"2026-02-23T11:32:11.218Z","avatar_url":"https://github.com/usrz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Express Error Log\n=================\n\nA very simple logger for [Express](http://expressjs.com/) 4.x, based on\nthe [`errorlog`](https://www.npmjs.com/package/errorlog) NPM module.\n\n* [Install and use](#install-and-use)\n* [Logging and sample JSON responses](#logging-and-sample-json-responses)\n  * [Numbers](#numbers)\n  * [Strings](#strings)\n  * [Objects](#objects)\n  * [Errors](#errors)\n* [Request IDs](#request-ids)\n* [Configuration](#configuration)\n* [License (MIT)](#license-mit-)\n\n\n\nInstall and use\n---------------\n\nInstall as usual with _NPM_:\n\n```bash\nnpm install --save express-errorlog\n```\n\nThen configure as the last routes of your Express app:\n\n```javascript\nvar errorlog = require('express-errorlog');\napp.use(errorlog);\n\n// The error handler writing the response\napp.use(function(err, req, res, next) {\n  res.json(err);\n})\n```\n\nThe `express-errorlog` handler will normalize whatever your application passed\nto the `next(...)` function and log an error message.\n\nIt will then pass the normalized error to the next error handler, which will\nhave the job of rendering the actual response to the client.\n\nThe examples below assume that the final error handler will simply send back\na JSON of the normalized error (no need to set the status again,\n`express-errorhandler` will set that for you already).\n\n\n\nLogging and sample JSON responses\n---------------------------------\n\nIn order to trigger log entries, simply use Express' own `next(...)` function,\npassing one of the the following types of parameter:\n\n#### Numbers\n\n```javascript\napp.get('/test', function(req, res, next) {\n  next(400); // Simply interrupt with a 400 Bad Request\n});\n```\n\nThe number will be interpreted as the status code of the response. If the number\nis less than zero or greater than 599, the response status will be normalized to\na _500 Internal Server Error_.\n\nThe response sent back to the client will contain the following:\n\n```json\nHTTP/1.1 400 Bad Request\nContent-Type: application/json\n\n{\n  \"status\": 400,\n  \"message\": \"Bad Request\"\n}\n```\n\nAnd the log will written with\n\n```text\n2015-03-30T16:45:01.661Z - GET /test (400) - Bad Request\n```\n\n#### Strings\n\n```javascript\napp.get('/test', function(req, res, next) {\n  next(\"Something is wrong\"); // Interrupt with a message\n});\n```\n\nThe number will be interpreted as the status message for the response, while the\nstatus will be defaulted to a _500 Internal Server Error_.\n\nThe response sent back to the client will contain the following:\n\n```json\nHTTP/1.1 500 Internal Server Error\nContent-Type: application/json\n\n{\n  \"status\": 500,\n  \"message\": \"Something is wrong\"\n}\n```\n\nAnd the log will written with\n\n```text\n2015-03-30T16:45:01.661Z - GET /test (500) - Something is wrong\n```\n\n#### Objects\n\n```javascript\napp.get('/test', function(req, res, next) {\n  var error = new Error('Invalid access for user');\n  error.user = 'pier@usrz.com';\n  error.token = 'c568019d-3c80-4685-8982-ed455a2c0cd1';\n\n  next({\n    status: 403,\n    message: 'You have no access, my friend',\n    error: error,\n    details: {\n      example: \"... some extra token for the response ...\"\n    },\n  });\n});\n```\n\nObjects can also be passed directly to the `next(...)` call, having the\nfollowing keys:\n\n* `status`: A _number_ representing the status code of the response.\n* `message`: The message to transmit to the client.\n* `error`: An `Error` that will be logged, but not transmitted to the client.\n* `details`: Anything that will be serialized to JSON and sent back alongside\n   the response.\n\nIn the example above, the response will be:\n\n```json\nHTTP/1.1 403 Forbidden\nContent-Type: application/json\n\n{\n  \"status\": 403,\n  \"message\": \"You have no access, my friend\",\n  \"details\": {\n    \"example\": \"... some extra token for the response ...\"\n  }\n}\n```\n\nAnd the log will contain something along the following:\n\n```text\n2015-03-30T16:45:01.718Z - GET /test (403) - You have no access, my friend\n  \u003e\u003e\u003e {\"example\":\"... some extra token for the response ...\"}\n  \u003e\u003e\u003e {\"user\":\"pier@usrz.com\",\"token\":\"c568019d-3c80-4685-8982-ed455a2c0cd1\"}\n  Error: Invalid access for user\n    at Error (native)\n    at ... stacktrace continues ...\n```\n\nIn other words, `details` and `error` will be logged  and the `Error`'s stack\ntrace will be dumped in full. At the same time, note that there is no trace of\nthe `error` in the response sent back to the client.\n\n#### Errors\n\n```javascript\napp.get('/test', function(req, res, next) {\n  // Create and instrument an error\n  var error = new Error('Something is amiss');\n  error.status = 410;\n  error.details = {\n    example: \"... some extra token for the response ...\"\n  };\n  // Equivalent to `next(error);`\n  throw error;\n});\n```\n\nWhether thrown or passed to `next(...)`, exceptions will produce a _500 Internal\nServer Error_ unless they expose a `status` property directly and their message\nwill be sent alongside the response, as:\n\n```json\nHTTP/1.1 410 Gone\nContent-Type: application/json\n\n{\n  \"status\": 410,\n  \"message\": \"Something is amiss\",\n  \"details\": {\n    \"example\": \"... some extra token for the response ...\"\n  }\n}\n```\n\nThe log will contain the full details and stack trace of the error:\n\n```text\n2015-03-30T16:45:01.718Z - GET /test (410) - Something is amiss\n  \u003e\u003e\u003e {\"example\":\"... some extra token for the response ...\"}\n  Error: Something is amiss\n    at Error (native)\n    at ... stacktrace continues ...\n```\n\n\n\nRequest IDs\n-----------\n\nIf the Express' `request` contains the special `id` value (as for example when\nusing [`express-request-id`](https://www.npmjs.com/package/express-request-id))\nsaid `id` will also be reported, for example:\n\n```text\n2015-03-30T16:45:01.661Z - d7c32387-3feb-452b-8df1-2d8338b3ea22 - GET /test (500) - Something is wrong\n```\n\n\n\nWrapped logger\n--------------\n\nThe wrapped `errorlog` instance also available as `log(...)`, for example:\n\n```javascript\nvar errorlog = require('express-errorlog');\napp.use(errorlog);\n\n// Log something\nerrorlog.log.info('This is an info message');\n```\n\n\n\nConfiguration\n-------------\n\nConfigure accepts basically the same options as\n[`errorlog`](https://www.npmjs.com/package/errorlog):\n\n```javascript\nvar errorlog = require('express-errorlog');\napp.use(errorlog({\n  logger: function/stream,\n}));\n```\n\n* `logger` may be one of the following:\n  * a `Writable` _stream_ to which error messages will be written to (actually\n    an object offering a `write(...)` function will do).\n  * a simple `function` that will be invoked once with each message to log.\n  * if unspecified this will default to `process.stderr`.\n* `category`: a category name that will be inserted in the message to log.\n\nAs with [`errorlog`](https://www.npmjs.com/package/errorlog), use a package\nlike [`logrotate-stream`](https://www.npmjs.com/package/logrotate-stream) if\nlog rotation is necessary in your environment.\n\n\n\nLicense (MIT)\n-------------\n\nCopyright (c) 2015 USRZ.com and Pier Paolo Fumagalli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusrz%2Fjs-express-errorlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusrz%2Fjs-express-errorlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusrz%2Fjs-express-errorlog/lists"}