Skip to content

Conversation

@SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Oct 29, 2025

Related to #37818

The logs from init include timestamps in format time.RFC3339 while other JSON logs use hclog.TimeFormat format.

This discrepancy is due to the logging implementation in #34886 avoiding hclog and instead printing a JSON string to the view's streams. If hclog was used directly then the calling code would not need to set a value for the timestamp and influence its format.

We can't get context from participants in the original PR to know why printing a JSON string was chosen and what limitations that might have been attempting to overcome. This PR assumes that there weren't any limitations and it was just unfamiliarity with hclog, which may or may not be true.

Regardless of why logging was implemented like that, making a change in the timestamp format may affect any systems consuming the logs, and at a minimum would require:

  • Checking that there's no breaking change in HCP Terraform.
  • Checking for required updates to terraform-exec and terraform-json.

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@SarahFrench SarahFrench force-pushed the sarah/make-init-json-output-use-defaults branch from 83d6866 to 113c455 Compare October 30, 2025 09:24
@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Changelog Warning

Currently this PR would target a v1.15 release. Please add a changelog entry for in the .changes/v1.15 folder, or discuss which release you'd like to target with your reviewer. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label.

@SarahFrench SarahFrench force-pushed the sarah/make-init-json-output-use-defaults branch from ed34b97 to 113c455 Compare October 30, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant