Search code examples
dockeramazon-ecsamazon-cloudwatchpython-logging

Can't see my python logs from ECS in CloudWatch


I am using MWAA that executes Python task using ECS. I tried to add logs with logger.info, but can't find them in CloudWatch. I am able to see logger.warning logs.

I tried to add:

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

to my python task and in my Docker file. (Added as a file with other functions by ENTRYPOINT.)

All my logs in MWAA are set to info.


Solution

  • It seems that your problem is not on ECS but on the log level, as python logging level is by default warning, what you are trying to do is get the info logs to be shown, try looking this question.