百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

node-lambda-log

> 编程语言
开源

Node.js Lambda 函数和其他 AWS 服务的基本日志记录机制,可生成 JSON 格式的日志,方便通过 Cloudwatch Logs 进行阅读。

193 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Node.js Lambda 函数和其他 AWS 服务的基本日志记录机制,可生成 JSON 格式的日志,方便通过 Cloudwatch Logs 进行阅读。

lambda-log

LambdaLog is a Node.js package 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.

Originally 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.

Why another lambda logger? There 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.

Features

Anyone can log JSON to the console, but with Lambda Log you also get:

  • Metadata and tags that may be set globally or individually for each log message.
  • Error and Error-like objects logged include stacktraces in the metadata automatically.
  • Each log message emits an event to allow third-party integration.
  • Pluggable and customizable by extending the LambdaLog class.
  • Pretty-printing of the JSON log message in dev mode.
  • Well documented, commented, and maintained source code.
  • Over 1.5 million downloads and more than 35k weekly downloads.
  • Small footprint.

New in Version 3.0.0

Version 3.0.0 of Lambda Log brings a bunch of changes, new features, and a new website.

Broad Changes:

  • Refactor all code to meet new ESLint specifications and to stay up-to-date with newer ecmascript specifications.
  • New website with better documentation.
  • Tests are now using Jest instead of Mocha.
  • Switched from TravisCI to Github Actions.

New Features:

  • Added levelKey configuration option to be able to change the key name for log levels.
  • Added messageKey configuration option to be able to change the key name for log messages.
  • Added tagsKey configuration option to be able to change the key name for tags.
  • Added ability to remove log level and tags from the outputted log JSON.
  • Added addLevel() method to quickly add a custom log level to an instance of LambdaLog.
  • Tags can now be functions that return a dynamic tag for log messages.
  • Tags now have variable support.
  • Tags that are null, undefined or "" are now removed from the tags array.
  • Metadata that contains Error objects are now automatically converted to a plain object.

Breaking Changes:

  • 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.
  • Tags no longer contain any default, built-in tags and are empty by default.
  • Some of the properties of LogMessage have been moved from the constructor to their own getter functions.

Documentation

Documentation for Lambda Log has moved to our new website.

Tests

See Development Documentation.

Contributing

See Contributing Documentation.

License

MIT License. See License in the repository.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Kyle Ross

Jonathan Goldwasser

Gabriel

sh1n1chi8acker

Matt Nagi

nickcox

Tim Schmidt

Marius Tolzmann

AndresQ

Mike Fogel

This project follows the all-contributors specification. Contributions of any kind welcome!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptawsaws-lambdacloudcloudwatch

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言