{"id":15631289,"url":"https://github.com/kyleross/node-lambda-log","last_synced_at":"2025-04-04T11:13:55.775Z","repository":{"id":19804593,"uuid":"87940031","full_name":"KyleRoss/node-lambda-log","owner":"KyleRoss","description":"Basic logging mechanism for Node.js Lambda Functions and other AWS services, which produces logs in JSON format for easier reading through Cloudwatch Logs.","archived":false,"fork":false,"pushed_at":"2023-04-18T09:43:58.000Z","size":4078,"stargazers_count":194,"open_issues_count":11,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-30T03:42:38.396Z","etag":null,"topics":["aws","aws-lambda","cloud","cloudwatch","error-handling","json","lambda","lambda-architecture","lambda-functions","lambda-log","log","logger","logging","metadata","node","nodejs","serverless"],"latest_commit_sha":null,"homepage":"https://lambdalog.dev","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/KyleRoss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"KyleRoss"}},"created_at":"2017-04-11T13:53:16.000Z","updated_at":"2024-10-09T19:42:15.000Z","dependencies_parsed_at":"2023-09-26T01:43:06.773Z","dependency_job_id":null,"html_url":"https://github.com/KyleRoss/node-lambda-log","commit_stats":{"total_commits":274,"total_committers":9,"mean_commits":"30.444444444444443","dds":"0.12408759124087587","last_synced_commit":"3cd3ee9d9ca1dc4520013f6a402acd6dd1c7f77a"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleRoss%2Fnode-lambda-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleRoss%2Fnode-lambda-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleRoss%2Fnode-lambda-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleRoss%2Fnode-lambda-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KyleRoss","download_url":"https://codeload.github.com/KyleRoss/node-lambda-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"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":["aws","aws-lambda","cloud","cloudwatch","error-handling","json","lambda","lambda-architecture","lambda-functions","lambda-log","log","logger","logging","metadata","node","nodejs","serverless"],"created_at":"2024-10-03T10:39:49.838Z","updated_at":"2025-04-04T11:13:55.733Z","avatar_url":"https://github.com/KyleRoss.png","language":"JavaScript","readme":"# lambda-log\n\n[![npm](https://img.shields.io/npm/v/lambda-log.svg?style=for-the-badge)](https://www.npmjs.com/package/lambda-log) [![npm](https://img.shields.io/npm/dt/lambda-log.svg?style=for-the-badge)](https://www.npmjs.com/package/lambda-log) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/KyleRoss/node-lambda-log/module?style=for-the-badge) [![Code Climate coverage](https://img.shields.io/codeclimate/coverage/KyleRoss/node-lambda-log?style=for-the-badge)](https://codeclimate.com/github/KyleRoss/node-lambda-log) [![license](https://img.shields.io/github/license/KyleRoss/node-lambda-log.svg?style=for-the-badge)](https://github.com/KyleRoss/node-lambda-log/blob/master/LICENSE) [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/KyleRoss/node-lambda-log?style=for-the-badge)](https://codeclimate.com/github/KyleRoss/node-lambda-log) [![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/KyleRoss/node-lambda-log?style=for-the-badge)](https://www.codefactor.io/repository/github/kyleross/node-lambda-log) [![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/lambda-log?style=for-the-badge)](https://snyk.io/advisor/npm-package/lambda-log)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nLambdaLog is a [Node.js package](https://www.npmjs.com/package/lambda-log) facilitates and enforces logging standards in Node.js processes or applications **anywhere** by formatting your log messages as JSON for simple parsing and filtering within log management tools, such as CloudWatch Logs. _Works with all of the supported versions of Node.js on Lambda._\n\nOriginally created for AWS Lambda Functions, LambdaLog is a lightweight and feature-rich library that has **no** dependency on AWS or Lambda, meaning you can use it in any type of Node.js project you wish. **It's really a universal JSON logger.**\n\n\n**Why another lambda logger?**\nThere are plenty of other logging libraries in the NPM ecosystem but most are convoluted, included more functionality than needed, not maintained, or are not configurable enough. I created LambdaLog to include the important functionality from other loggers, but still maintaining simplicity with minimal dependencies.\n\n### Features\n\nAnyone can log JSON to the `console`, but with Lambda Log you also get:\n\n- Metadata and tags that may be set globally or individually for each log message.\n- Error and Error-like objects logged include stacktraces in the metadata automatically.\n- Each log message emits an event to allow third-party integration.\n- Pluggable and customizable by extending the LambdaLog class.\n- Pretty-printing of the JSON log message in dev mode.\n- Well documented, commented, and maintained source code.\n- Over 1.5 million downloads and more than 35k weekly downloads.\n- Small footprint.\n\n#### New in Version 3.0.0\n\nVersion 3.0.0 of Lambda Log brings a bunch of changes, new features, and a [new website](https://lambdalog.dev).\n\n**Broad Changes:**\n\n* Refactor all code to meet new ESLint specifications and to stay up-to-date with newer ecmascript specifications.\n* New website with better documentation.\n* Tests are now using Jest instead of Mocha.\n* Switched from TravisCI to Github Actions.\n\n**New Features:**\n\n- Added `levelKey` configuration option to be able to change the key name for log levels.\n- Added `messageKey` configuration option to be able to change the key name for log messages.\n- Added `tagsKey` configuration option to be able to change the key name for tags.\n- Added ability to remove log level and tags from the outputted log JSON.\n- Added `addLevel()` method to quickly add a custom log level to an instance of LambdaLog.\n- Tags can now be functions that return a dynamic tag for log messages.\n- Tags now have variable support.\n- Tags that are `null`, `undefined` or `\"\"` are now removed from the tags array.\n- Metadata that contains `Error` objects are now automatically converted to a plain object.\n\n**Breaking Changes:**\n\n- All of the private properties of both the LambdaLog and LogMessage classes are stored using Symbols. This may break some advanced uses of Lambda Log from version 2.\n- Tags no longer contain any default, built-in tags and are empty by default.\n- Some of the properties of LogMessage have been moved from the constructor to their own getter functions.\n\n\n\n## Documentation\n\nDocumentation for Lambda Log has moved to our [new website](https://lambdalog.dev).\n\n\n\n## Tests\n\nSee [Development Documentation](https://lambdalog.dev/docs/latest/development).\n\n\n\n## Contributing\n\nSee [Contributing Documentation](https://lambdalog.dev/docs/latest/contributing).\n\n\n\n## License\n\nMIT License. See [License](https://github.com/KyleRoss/node-lambda-log/blob/master/LICENSE) in the repository.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://kyleross.me/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2508347?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKyle Ross\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/commits?author=KyleRoss\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/KyleRoss/node-lambda-log/commits?author=KyleRoss\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#maintenance-KyleRoss\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/jogold\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/12623249?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJonathan Goldwasser\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/commits?author=jogold\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/KyleRoss/node-lambda-log/issues?q=author%3Ajogold\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/gagres\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/10873171?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGabriel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-gagres\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/sh1n1chi8acker\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/9838599?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003esh1n1chi8acker\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/issues?q=author%3Ash1n1chi8acker\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/pleonasm\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/619447?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMatt Nagi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/commits?author=pleonasm\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/nickcox\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/135552?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003enickcox\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/commits?author=nickcox\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/taschmidt\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/228736?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTim Schmidt\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/commits?author=taschmidt\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://mineiros.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/918717?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarius Tolzmann\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/KyleRoss/node-lambda-log/issues?q=author%3Amariux\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.jengibre.com.ar\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/192908?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAndresQ\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-tulsidas\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://mike.fogel.ca\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/69902?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMike Fogel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-mfogel\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":["https://github.com/sponsors/KyleRoss"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyleross%2Fnode-lambda-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyleross%2Fnode-lambda-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyleross%2Fnode-lambda-log/lists"}