Fork me on GitHub
#aws
<
2019-01-28
>
deanjohnson0310:01:04

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?

dottedmag10:01:03

Here's Go tool that pushes logs to CloudWatch for the reference: https://github.com/boxfuse/cloudwatchlogs-agent

deanjohnson0311:01:06

@dottedmag Thank you, I will check out the links you sent me 🙂

viesti12:01:51

If you run in ECS, you can use the awslogs docker log driver and stdout/stderr will be shipped to Cloudwatch

viesti12:01:02

probably good to let someone else than your app to take care of shipping logs to the Cloudwatch service

dottedmag14:01:41

On a regular EC2 their agent can also read and submit logs from files.

valtteri14:01:56

ElasticBeanstalk also provides pre-configured log streaming to CloudWatch.

valtteri14:01:32

It might be the easiest one to get started with.

ghadi17:01:18

@deanjohnson03 are you using normal ECS or Fargate?

deanjohnson0317:01:50

Thank you everyone

deanjohnson0317:01:05

@ghadi we are using Fargate at the moment

ghadi17:01:58

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

deanjohnson0317:01:58

Oh! Well that makes things a lot simpler 😄

deanjohnson0317:01:41

Thank you very much, for your help. Thank you everyone for your responses they have been really helpful. I appreciate it 🙂