Skip to content

Commit 3df28c3

Browse files
authored
fix: Make terraform init JSON log timestamps include millisecond precision (#37818)
* fix: terraform init log timestamps include millisecond precision * docs: add changelog entry
1 parent 808713f commit 3df28c3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: ENHANCEMENTS
2+
body: terraform init log timestamps include millisecond precision
3+
time: 2025-10-27T13:22:38.714891768-05:00
4+
custom:
5+
Issue: "37818"

internal/command/views/init.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010
"time"
1111

12+
"github.com/hashicorp/go-hclog"
1213
"github.com/hashicorp/terraform/internal/command/arguments"
1314
"github.com/hashicorp/terraform/internal/tfdiags"
1415
)
@@ -97,7 +98,7 @@ func (v *InitJSON) Output(messageCode InitMessageCode, params ...any) {
9798
return
9899
}
99100

100-
current_timestamp := time.Now().UTC().Format(time.RFC3339)
101+
current_timestamp := time.Now().UTC().Format(hclog.TimeFormat)
101102
json_data := map[string]string{
102103
"@level": "info",
103104
"@message": preppedMessage,

0 commit comments

Comments
 (0)