指定AWS Lambda的日志组? [英] Specify log group for an AWS lambda?

查看:95
本文介绍了指定AWS Lambda的日志组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以指定AWS Lambda记录到的CloudWatch日志组?它似乎是直接从lambda名称生成的;但是,例如将多个lambda聚合到单个日志组将特别方便。当用CloudFormation模板创建lambda时,我们特别希望指定日志组。

Is there a way to specify the CloudWatch log group that an AWS lambda logs to? It seems to be generated directly from the lambda name; however, it would be especially convenient to, for example, aggregate multiple lambdas to a single log group. We are especially interested in specifying the log group when the lambda is created by a CloudFormation template.

推荐答案

我不认为

即使有可能,每个AWS Lambda实例仍将写入其自己的日志流。尽管同一lambda的不同调用可以写入同一日志流(当重用lambda实例时),但是对于不同的lambda绝对不是这种情况(因为它们必须使用不同的lambda实例) )。

Even if it were possible, each AWS Lambda instance would still write to its own log-stream. And though different invocations of the same lambda can write to the same log-stream (when the lambda instance is reused), this will definitely not be the case for different lambdas (since they must use different lambda instances).

因此,您必须具有汇总多个日志流的工具。如果是这样,那么使其通用性有什么问题,以便它可以汇总来自不同日志组的日志流?

As a result, you must have a tool that aggregates multiple log-stream. If so, what's the problem with making it a little more generic, so that it can aggregate log-streams from different log groups?

这篇关于指定AWS Lambda的日志组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆