terraform-exec icon indicating copy to clipboard operation
terraform-exec copied to clipboard

Unable to set log level without writing to file

Open wandergeek opened this issue 1 year ago • 1 comments

Hey there legends! 👋

I'm trying to set TF_LOG using tf.SetLog("TRACE") and I am not getting any TRACE logging unless I also set the TF_LOG_PATH. Looking closer at the code, it looks like this is expected behavior? https://github.com/hashicorp/terraform-exec/blob/main/tfexec/cmd.go#L154-L166

Is there a way I can get TRACE logging without having to set the log path as well?

Cheers, Nick

wandergeek avatar Jan 25 '24 02:01 wandergeek

Even weirder, when I use SetLogPath to set the logging destination file, I don't actually get a file out. Taking a stab in the dark, maybe this has something to do with overwriting the logging destinations? https://github.com/hashicorp/terraform-exec/blob/e26205510919b4f893bb1370e000835b5d16ae4d/tfexec/cmd_default.go#L27-L45

wandergeek avatar Jan 25 '24 02:01 wandergeek