Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
Logs to AWS Cloudwatch from Docker Containers

I have a few docker containers running with docker-compose on an AWS EC2 instance. I am looking to get the logs sent to AWS CloudWatch. I was also having issues getting the logs from docker containers to AWS CloudWatch from my Mac running Sierra so I've moved over to EC2 instances running Amazon AMI.

My docker-compose file:

version: '2'
services:
  scraper:
  build: ./Scraper/
  logging:
    driver: "awslogs"
    options:
       awslogs-region: "eu-west-1"
       awslogs-group: "permission-logs"
       awslogs-stream: "stream"
  volumes:
    - ./Scraper/spiders:/spiders

When I run docker-compose up I get the following error:

scraper_1 | WARNING: no logs are available with the 'awslogs' log driver

but the container is running. No logs appear on the AWS CloudWatch stream. I have assigned an IAM role to the EC2 container that the docker-containers run on.

I am at a complete loss now as to what I should be doing and would apprecaite any advice.

about 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

The awslogs works without using ECS.

you need to configure the AWS credentials (the user should have IAM roles appropriate [cloudwatch logs]).

I used this tutorial, it worked for me: https://wdullaer.com/blog/2016/02/28/pass-credentials-to-the-awslogs-docker-logging-driver-on-ubuntu/

about 4 years ago · Santiago Trujillo Denunciar

0

I was getting the same error but when I checked the cloudwatch logs, I was able to see the logs in cloudwatch. Did you check that if you have the logs group created in cloudwatch. Docker doesn't support console logging when we use the custom logging drivers.

The section on limitations here says that docker logs command is only available for json-file and journald drivers, and that's true for built-in drivers.

When trying to get logs from a driver that doesn't support reading, nothing hangs for me, docker logs prints this:

Error response from daemon: configured logging driver does not support reading
about 4 years ago · Santiago Trujillo Denunciar

0

There are 3 main steps involved it to it.

  1. Create an IAM role/User
  2. Install CloudAgent
  3. Modify docker-compose file or docker run command

I have referred an article here with steps to send the docker logs to aws cloudwatch.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda