Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 50 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 50
Topic #: 1
[All Terraform Associate Questions]

Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.

  • A. True
  • B. False
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Oskar_Madin
Highly Voted 2 years, 4 months ago
please stop writing or suggestions if you don't know the answer or are not sure!
upvoted 66 times
...
esandips
Highly Voted 2 years, 6 months ago
B TF_LOG_PATH needs to be set as well
upvoted 23 times
bigboi23
2 years, 6 months ago
No. A is correct. To persist logged output you can set TF_LOG_PATH in order to force the log to always be appended to a specific file when logging is enabled. Note that even when TF_LOG_PATH is set, TF_LOG must be set in order for any logging to be enabled.
upvoted 2 times
...
scepticemia
2 years, 6 months ago
Incorrect. A is the correct answer. TF_LOG_PATH just enables persistent logging to be appended to a specific file. From the docs: To persist logged output you can set TF_LOG_PATH in order to force the log to always be appended to a specific file when logging is enabled. https://www.terraform.io/internals/debugging
upvoted 4 times
...
nhatne
2 years, 4 months ago
B is correct because TF_LOG_PATH IS NOT REQUIRED, in the docs, they do not mention HAVE TO SET TF_LOG_PATH, it is optional, therefore without TF_LOG_PATH will cause detailed logs to appear on stderr.
upvoted 5 times
...
...
starkonbullet
Most Recent 6 months, 1 week ago
Selected Answer: B
B. False. Setting the TF_LOG environment variable to "DEBUG" does not cause debug messages to be logged into syslog. It actually causes the Terraform command-line tool to emit detailed debug output to the console (standard error output, specifically).
upvoted 4 times
...
kingfighers
7 months, 3 weeks ago
B Terraform has detailed logs that you can enable by setting the TF_LOG environment variable to any value. Enabling this setting causes detailed logs to appear on stderr. https://developer.hashicorp.com/terraform/internals/debugging
upvoted 1 times
...
vibzr2023
8 months ago
B is correct Setting the TF_LOG environment variable to DEBUG does indeed enable detailed debug messages from Terraform, but these messages are not automatically logged to syslog. By default, when TF_LOG is set, Terraform logs messages to stderr. To direct these logs to a file or another logging destination like syslog, you would need to manually redirect the output or use additional tools or settings specific to your operating system or environment. For example, in a Unix-like environment, you could redirect the Terraform command's stderr to a file or to syslog using command-line redirection or tools like logger. But this is not something Terraform does automatically just by setting TF_LOG to DEBUG. To log Terraform's output to a file, you might run a command like: TF_LOG=DEBUG terraform apply 2>terraform-debug.log
upvoted 2 times
...
Siva_7282
9 months, 4 weeks ago
Selected Answer: B
B. False Setting the TF_LOG environment variable to DEBUG does not automatically log debug messages into syslog. Instead, it causes Terraform to print debug messages to the standard error (stderr) output. If you want to capture or redirect these debug messages, you need to handle the stderr output accordingly, such as redirecting it to a file or using other logging mechanisms.
upvoted 7 times
...
SauravAmuze
9 months, 4 weeks ago
Terraform has detailed logs that you can enable by setting the TF_LOG environment variable to any value. Enabling this setting causes detailed logs to appear on 'stderr' .There is no mention of 'syslog' in the manual. So the answer is B (False)
upvoted 1 times
...
DianaPopal
11 months ago
B. False Setting the TF_LOG environment variable to DEBUG in Terraform does not cause debug messages to be logged into syslog. The TF_LOG environment variable is used to control the logging level of Terraform itself, not the system's syslog service. When TF_LOG is set to DEBUG, Terraform will output detailed debug messages to the standard error output (stderr) or the log file specified in the Terraform configuration.
upvoted 3 times
...
MisterR0B0T
1 year ago
The answer is False. Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged to the standard error stream (stderr). It does not log messages to syslog. Syslog is a standard logging system that is used by many Unix-like operating systems to collect and store system log messages. Syslog messages are typically stored in a file called /var/log/syslog. Terraform does not log messages to syslog by default. To log Terraform messages to syslog, you can use a third-party logging tool, such as Logstash or Fluentd. These tools can be configured to collect logs from stderr and send them to syslog. Here is an example of how to use Logstash to send Terraform logs to syslog: input { stdin { type => "plain" filter => { remove_field => ["message.level"] add_field => { "message.level" => "debug" } } } } output { syslog { host => "localhost" } }
upvoted 8 times
...
gofavad926
1 year, 1 month ago
Selected Answer: A
A, it appears in stderr. As documentation says: "Terraform has detailed logs that you can enable by setting the TF_LOG environment variable to any value. Enabling this setting causes detailed logs to appear on stderr."
upvoted 2 times
...
Halimb
1 year, 2 months ago
Selected Answer: B
https://developer.hashicorp.com/terraform/cli/config/environment-variables Quote "Enables detailed logs to appear on stderr which is useful for debugging." By default, regardless of the log level, Terraform writes its log output to the standard error (stderr) stream. This behavior is useful for capturing log messages in the terminal or console where you are running Terraform commands, allowing you to see any warnings or errors in real-time. If you wish to redirect the log output to a file or another destination, you can use standard shell redirection as shown in my previous response. This allows you to save the log information for later analysis or to separate it from the terminal output.
upvoted 3 times
...
Spandrop
1 year, 2 months ago
Correct answer is B "Terraform has detailed logs that you can enable by setting the TF_LOG environment variable to any value. Enabling this setting causes detailed logs to appear on stderr." There is nothing to do with syslog https://developer.hashicorp.com/terraform/internals/debugging
upvoted 2 times
...
debabrata6983
1 year, 2 months ago
Selected Answer: B
B is the right answer and stop confusing people
upvoted 1 times
...
AWS_cert2023
1 year, 5 months ago
Enabling this setting causes detailed logs to appear on stderr. Uses TF_LOG_PATH to change the path of log info.
upvoted 1 times
...
nirosha1
1 year, 7 months ago
Selected Answer: A
Terraform has detailed logs that you can enable by setting the TF_LOG environment variable to any value. Enabling this setting causes detailed logs to appear on stderr. https://developer.hashicorp.com/terraform/internals/debugging
upvoted 2 times
...
AzRNoob
1 year, 7 months ago
FALSE Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged to standard error (stderr) output, not to syslog.
upvoted 8 times
...
camps
1 year, 7 months ago
Selected Answer: B
B. False. Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged to the console, not to syslog. The TF_LOG environment variable is used to control the level of logging in Terraform. When set to DEBUG, Terraform will log detailed debug messages to the console, which can be useful for troubleshooting issues.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...