# I built my own AWS Cloudwatch log forwarder as an npm package
Oct 9, 2016 1 minute readAWS Cloudwatch is an outstanding monitoring platform. With competitive prices, it is extremely configurable and extensible. Unfortunately, monitoring resources outside of AWS is not straightforward. To solve this problem I created my own Cloudwatch log forwarder
as a non-intrusive npm
package.
What’s wrong with the existing log forwarding tools?
Amazon provides a CloudWatch Logs Agent to forward logs. This agent must be installed as a service running on a server. While this is easy on EC2 instances, it is impossible to do in shared environments such as Heroku.
Amazon built the CloudWatch Logs API and SDKs for developers to interact with the system. While these SDKs are relatively simple to use, they still require a fair amount of work and understanding of the API.
Third-party developers have built their own forwarding tools based on the Cloudwatch SDKs. However, they all share the same problem. The application code would have to change to explicitly log to Cloudwatch. Moreover, the majority of the javascript tools can only be used from other javascript applications.
Why I built the aws-cloudwatch-forwarder
?
-
It can be used outside of AWS: The
aws-cloudwatch-forwarder
will process logs from anywhere. -
It doesn’t need an agent installation: Built as a regular
npm
package, it can be used as a standalone tool such asecho
orgrep
. Yes, you can use it to send your Heroku logs to AWS Cloudwatch. -
No need to change any existing code: It can be used with existing applications. Even if they’re not built with javascript.
aws-cloudwatch-forwarder 'echo "sample application"'
How do I use it?
Visit the aws-cloudwatch-forwarder
npm
page for the latest documentation
I want to see how it works
The aws-cloudwatch-forwarder is entirely open source