{"id":15390269,"url":"https://github.com/gajus/roarr-middleware-serialize-error","last_synced_at":"2025-04-15T21:27:40.569Z","repository":{"id":66001232,"uuid":"141431152","full_name":"gajus/roarr-middleware-serialize-error","owner":"gajus","description":"Serializes error objects in the Roarr message context.","archived":false,"fork":false,"pushed_at":"2019-03-24T09:44:11.000Z","size":7,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T12:50:31.958Z","etag":null,"topics":["log","middleware","roarr"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.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}},"created_at":"2018-07-18T12:22:19.000Z","updated_at":"2022-07-18T01:08:58.000Z","dependencies_parsed_at":"2023-06-06T08:00:31.120Z","dependency_job_id":null,"html_url":"https://github.com/gajus/roarr-middleware-serialize-error","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"3036b6d11f13b37392a026e55a07fb806e841819"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-middleware-serialize-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-middleware-serialize-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-middleware-serialize-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-middleware-serialize-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/roarr-middleware-serialize-error/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233690489,"owners_count":18714784,"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","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":["log","middleware","roarr"],"created_at":"2024-10-01T15:05:10.052Z","updated_at":"2025-01-13T04:18:19.306Z","avatar_url":"https://github.com/gajus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @roarr/middleware-serialize-error\n\n[![Travis build status](http://img.shields.io/travis/gajus/roarr-middleware-serialize-error/master.svg?style=flat-square)](https://travis-ci.org/gajus/roarr-middleware-serialize-error)\n[![Coveralls](https://img.shields.io/coveralls/gajus/roarr-middleware-serialize-error.svg?style=flat-square)](https://coveralls.io/github/gajus/roarr-middleware-serialize-error)\n[![NPM version](http://img.shields.io/npm/v/@roarr/middleware-serialize-error.svg?style=flat-square)](https://www.npmjs.com/package/@roarr/middleware-serialize-error)\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social\u0026label=Follow)](https://twitter.com/kuizinas)\n\nSerializes error objects in the [Roarr](https://github.com/gajus/roarr) message context.\n\n## Behaviour\n\nThe current implementation maps only the direct context properties.\n\nRaise an issue if you have a use case that requires deep property mapping.\n\n## Usage\n\n```js\nimport log from 'roarr';\nimport createSerializeErrorMiddleware from '@roarr/middleware-serialize-error';\n\nconst childLog = log\n  .child({name: 'foo'})\n  .child(createSerializeErrorMiddleware());\n\nconst error = new Error('foo');\n\nlog.debug({error}, 'bar');\nchildLog.debug({error}, 'bar');\n\n// {\"context\":{\"logLevel\":20,\"error\":{}},\"message\":\"bar\",\"sequence\":0,\"time\":1531918373676,\"version\":\"1.0.0\"}\n// {\"context\":{\"logLevel\":20,\"error\":{\"name\":\"Error\",\"message\":\"foo\",\"stack\":\"[REDACTED]\"}},\"message\":\"bar\",\"sequence\":1,\"time\":1531918373678,\"version\":\"1.0.0\"}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Froarr-middleware-serialize-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Froarr-middleware-serialize-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Froarr-middleware-serialize-error/lists"}