-
Notifications
You must be signed in to change notification settings - Fork 28
UX: improve log formatting & info (on refresh & show) #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sounds interesting. Can you please add a bit more of context?
It looks like we're starting to find out that Terraform wasn't meant as a command–line application prototyping toolkit, but rather as a specialized tool to manage persistent (i.e. non ephemeral) infrastructure. Footnotes |
Exactly we could control a bit where or how to see the logs aside the infamous
In reality this task is much more looking at the future. At some point we should have all the logic control within go. WE need to create that code in go that handles the task and do the data syncing in go... a proper executor engine and no the current solution that allow us to have more control on this and other things. But at least I can see the logs on refresh without having to read uncomfortable json in the command line
Not that much than the having logs if the setup |
We are not using and never did use Terraform because is a command–line application prototyping toolkit. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Do you mean that the sole fact of running |
Do you mean that the sole fact of running |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
With export TF_LOG im able to see the logs using logrus we could also output to something more friendly, and when we have the executor in place we could see real time logs where ever we wanted |
At least the MVP is: |
The last sentence is more from a UX perspective. In any case the task is discern an implement how we can bring the information that the users are demanding. Regarding to the events and task information. Even if at the last we are going to use pure JSON. |
Of course, but we can't ask users to manually set
For example? A file?
How? |
Do you mean that resource "iterative_task" "example" {
script = <<-END
#!/bin/sh
echo "Hello world from the cloud!"
END
} $ terraform refresh
iterative_task.example: Refreshing state... [id=tpi-example-a1b2c3-d4e5f6]
[INFO] Hello world from the cloud!
Again, this is a line we shouldn't probably cross. Asking users to enable this feature during the normal operation of the program is rather cumbersome and inelegant. |
Centralised logging from the client side sounds like the worst of both worlds. 🤔 Still, “centralised logging” in general sounds like an interesting topic to explore after the public release. |
Which sentence?
If “the task [1]” means “this issue” and “task [2]” means
Like in #389 (comment)? 🤔 Doesn't sound especially user friendly. |
Syslog i.e. being able to redirect syslog to many decentralised logging solutions.
Ehrr... why not? If we just only have this way to enable logs... at least we have somehow and they are able to see it properly
correct |
Terraform explicitly forbids providers from interacting with the terminal standard input/output/error for good reasons. It's an infrastructure management tool, not a command–line interface toolkit.
Asking users to set
|
It's still unclear to me what's the use for
|
task
insightful logs on refresh
When I read this I have the impression that you never had to deal with logs. Tools like logstash, graylog, are used and then you are able to filter, search... Rsyslog is the standard here |
The whole team agreed on using TF_LOG in the last meeting |
https://en.wikipedia.org/wiki/Ad_hominem
None of those tools is intended for local use. Again, does your proposal include a centralized log aggregation service?
Yes, but, again, not locally. Also, not every log aggregation service supports it natively; e.g. AWS CloudWatch. XKCD 927
Except from this Slack message:Terraform discards provider debug logs by default. Users can set the TF_LOG_PROVIDER and TF_LOG_PATH environment variables to route these logs to a file or to the terraform standard output. Still, those debug logs are not meant for end users: resource blocks are processed in parallel, and log lines from different operations are interleaved in unpredictable ways. |
Log what we store in logs and events within the terraform status using the terraform CLI during refresh using logrus. This way would be easier to visualise the logs within the Terraform CLI.
This also applies to current existing logs in creation and destroy.
According to @dmpetrov feedback ideally:
The text was updated successfully, but these errors were encountered: