将日志运送到lumigo平台
lumigo-log-shipper的Python项目详细描述
lumigo python日志托运人
Lumigo Log Shipper API允许将Lambda函数的日志流式传输到Lumigo,作为自定义日志传送函数的一部分。在
注意:Lumigo将自动尝试为Kinesis数据流订阅Lambda函数。如果您的日志组已经订阅了Lambda作为目的地,请使用此库将日志发送到Lumigo。在
请通过平台聊天联系Lumigo的支持,以便我们为您启用此功能。在
使用
安装lumigo-log-shipper
:
皮普:
$ pip install lumigo-log-shipper
在你的船运记录中:
^{pr2}$如果使用的是编程错误,请添加自定义error关键字作为附加参数。这还将发送包含自定义表达式的日志供Lumigo处理。在
fromlumigo_log_shipperimportlumigo_shipperdefhandler(event,context):lumigo_shipper.ship_logs(event,["WARNING-EXAMPLE"])
添加到lambda的serverless.yml
iamRoleStatements: - Effect: Allow Action: - "firehose:PutRecordBatch" Resource: - "arn:aws:firehose:[YOUR-REGION]:114300393969:deliverystream/prod_logs-edge-stfl_customer-logs-firehose" - Effect: Allow Action: - "sts:AssumeRole" Resource: - "arn:aws:iam::114300393969:role/prod-CustomerLogsWriteRole"
- 项目
标签: