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 ....
if you run in Docker, there's awslogs driver (comes with Docker) which can ship logs to Cloudwatch
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
agent is good in that if the app goes wonky, then logs will still probably be shipped
but if in docker land, I'd go for awslogs agent
I use Fargate, and send my logs to stdout
There are logback appenders that send logs to CloudWatch Logs, for example: https://github.com/dibog/cloudwatch-logback-appender
You can configure it via logback.xml
.
This can be used if you have normal java process running on EC2 instance.
this is the case handled by awslogs driver (from user point of view, logging happens to stdout)
those appenders tend to pull in a lot of dependencies