Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
Logs not showing up in AWS Cloudwatch

I have been trying to get logging to work on AWS Cloudwatch but have been unsuccessful so far. I am running a python flask backend on Fargate and handling logging through Cloudwatch. Only error messages are showing up however and nothing about the logs I have inserted. I will get error messages on cloudwatch and startup messages but no logs.

 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Restarting with windowsapi reloader
 * Debugger is active!
 * Debugger PIN: 222-692-161
 * Running on http://0.0.0.0:6000/ (Press CTRL+C to quit)

127.0.0.1 - - [03/Nov/2020 09:47:23] "GET /health HTTP/1.1" 200 -

This is shown on Cloudwatch, the flask startup dialogue and messages that the healthcheck query worked properly/ However no logs from within my health check. I have tried 2 strategies.

  1. The logging library
import logging

logger = logging.getLogger(level=logging.INFO)
log.info("This is an informative log")

and I have also define a print function to send data to stderr so I could have cloudwatch pick it up


def eprint(cls, *args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
eprint("this is another informative log")

I am not sure why neither of these solutions is working as Cloudwatch should pick up on data sent to stderr. Is there a way to enable Cloudwatch logs in a few lines of code and as minimally invasive as possible?

Thank you in advance!

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda