Fork me on GitHub
#aws
<
2020-01-27
>
souenzzo17:01:18

Hello I'm curentilty using logback for logging, what is the easiest path to get my logging into CloudWatch? I see that there is many paths: log to file > file to cloudwatch, logback provider, slf4j provider ....

viesti17:01:01

if you run in Docker, there's awslogs driver (comes with Docker) which can ship logs to Cloudwatch

viesti17:01:41

if you run in EC2, there's Cloudwatch logs agent, which can ship logs to Cloudwatch: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html

viesti17:01:44

agent is good in that if the app goes wonky, then logs will still probably be shipped

viesti17:01:40

but if in docker land, I'd go for awslogs agent

ghadi17:01:53

I use Fargate, and send my logs to stdout

viesti19:01:51

this is the case handled by awslogs driver (from user point of view, logging happens to stdout)

jsyrjala17:01:47

There are logback appenders that send logs to CloudWatch Logs, for example: https://github.com/dibog/cloudwatch-logback-appender

jsyrjala18:01:26

You can configure it via logback.xml .

jsyrjala18:01:02

This can be used if you have normal java process running on EC2 instance.

ghadi19:01:29

those appenders tend to pull in a lot of dependencies