scottwinkler / terraform-provider-shell

Terraform provider for executing shell commands and saving output to state file
Mozilla Public License 2.0
278 stars 61 forks source link

Not usable without TF_LOG=TRACE #93

Open SebTardif opened 3 years ago

SebTardif commented 3 years ago

I wonder if someone figured out how to use 'as-is' and still get error message to shows-up without TF_LOG=TRACE. Even DEBUG is not good enough. Whatever happen in the script are just hidden, so each time something is wrong you need to run TF_LOG=TRACE, then in life nothing ever work so I need to always run with TF_LOG=TRACE and it's kind of annoying.

rlewkowicz commented 2 years ago

Debug works. Use set -x to make the script it's self print debug and you'll see it in your debug output

TJM commented 1 year ago

We have found the same thing. The "null" resource will display output as it runs, but "shell" only does so after it fails and then it is all jumbled up (all the newlines are gone), and STDOUT and STDERR are split, so it's hard to tell where the error came from. We have to run in TRACE mode and go look through the trace log. It would be nice if we could just see the output right in the terraform run.

icj217 commented 1 year ago

Seeing the same issue. Using TF_LOG_PROVIDER=TRACE seems to be the most constrained flag that'll enable logs from the provider without enabling it for TF core.

It would be really nice if we could configure the log level of our scripts so that the stdout/stderr shows up in regular terraform commands without debug/trace logging enabled.