MMA
MMA

Reputation: 51

How to send logs generated within code to AWS?

I am trying to send the logs (being generated as a part of my on-premise device and the message being sent or received using devices onboarded on greengrass) to AWS.

How is it possible?

I wanted to check SDKs also but found no documentation stating how to do it online.

Upvotes: 0

Views: 1635

Answers (2)

srk
srk

Reputation: 1901

You should use a logging framework or some other abstraction so your code is not tightly coupled to AWS CloudWatch. Then you can easily change the log destination (CloudWatch, file, database) without changing your code.

For example, let's say you're using .NET. Here is how you can configure popular .NET logging frameworks to send logs to CloudWatch. Or here is a solution for Python. I'm sure there are similar solutions in other languages/frameworks.

If you are already generating log files, another option is to use the CloudWatch Agent to send those existing logs to CloudWatch.

Upvotes: 2

Voronin Roman
Voronin Roman

Reputation: 267

In order to send logs to Cloudwatch just use Cloudwatch agentю Install Cloudwatch agent

You can send logs to Elasticsearch using logstash as well.

Upvotes: 0

Related Questions