Search code examples
amazon-web-servicesstdoutaws-clistderr

AWS CLI --debug ouputs to stderror instead of stdout


We have added the --debug flag to all our AWS CLI commands so that we get more information on what is happening during deployments on our CI/CD servers.

The problem is that all debug output is written to stderr instead of stdout, which leads to a lot of messages popping up as errormessages, although they are just debug information.

How can I configure the AWS CLI to output debug messages to stdout?

EDIT: how can I do this without redirecting stdout? If I redirect it I will nog be able to access the debug output on my CD/CI server.


Solution

  • You can redirect stderr to stdout with the 2>&1 construction.

    See https://askubuntu.com/questions/625224/how-to-redirect-stderr-to-a-file