Usage of error stream #7065
-
|
Sam prints a lot of information to the error stream during build and deploy operations. Is this behavior expected or a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Yes, this behavior is expected. SAM intentionally writes a lot of its diagnostic, progress, and informational output to stderr, not stdout. This includes messages printed during Why SAM does this:
This design allows commands like: sam deploy --guided --output json > output.json to work reliably without polluting stdout with human-readable logs. Is it a bug? No. It is a deliberate CLI design choice, and SAM follows the same pattern as many other developer tools (including parts of the AWS CLI itself). Implications for scripting and CI:
sam build 2>/dev/null
sam deploy > all.log 2>&1 Summary: SAM printing lots of information to stderr is expected behavior. |
Beta Was this translation helpful? Give feedback.
Yes, this behavior is expected.
SAM intentionally writes a lot of its diagnostic, progress, and informational output to stderr, not stdout. This includes messages printed during
sam build,sam deploy, and related commands.Why SAM does this:
stdoutis reserved for machine-readable output (JSON, templates, values that users or scripts may want to capture).stderris used for:This design allows commands like:
sam deploy --guided --output json > output.json
to work reliably without polluting stdout with human-readable logs.
Is it a bug?
No. It is a deliberate CLI design choice, and SAM follows the same pattern as…