Hey everyone, I hope you are well! We are writing a Clojure app which will run in an AWS container. We would like to be able to write logs from Clojure into Cloudwatch so we can get to all the logs from one place. I have been reading the AWS documentation and I am not seeing any way of doing this effectively. Could someone point me in the right direction?
@deanjohnson03 https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html ?
Here's Go tool that pushes logs to CloudWatch for the reference: https://github.com/boxfuse/cloudwatchlogs-agent
@dottedmag Thank you, I will check out the links you sent me 🙂
If you run in ECS, you can use the awslogs docker log driver and stdout/stderr will be shipped to Cloudwatch
probably good to let someone else than your app to take care of shipping logs to the Cloudwatch service
On a regular EC2 their agent can also read and submit logs from files.
ElasticBeanstalk also provides pre-configured log streaming to CloudWatch.
It might be the easiest one to get started with.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudwatchlogs.html
@deanjohnson03 are you using normal ECS or Fargate?
Thank you everyone
@ghadi we are using Fargate at the moment
Me too. No agent or API interaction is necessary. If you write your logs to stdout it will go to the configured CloudWatch group/stream
Oh! Well that makes things a lot simpler 😄
Thank you very much, for your help. Thank you everyone for your responses they have been really helpful. I appreciate it 🙂