Skip to content
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

Legacy logging configuration causes incorrect log level setting #1976

Closed
the-nando opened this issue Aug 14, 2023 · 0 comments · Fixed by #2031
Closed

Legacy logging configuration causes incorrect log level setting #1976

the-nando opened this issue Aug 14, 2023 · 0 comments · Fixed by #2031

Comments

@the-nando
Copy link

the-nando commented Aug 14, 2023

Terraform Version

Terraform v1.5.5
on darwin_arm64

Affected Resource(s)

Please list the resources as a list, for example:

  • resource_pki_secret_backend_cert.go
    Probably more.

Terraform Configuration Files

resource "vault_pki_secret_backend_cert" "static" {
  for_each              = local.additional_certificates
  backend               = var.vault_pki_mount
  name                  = var.vault_pki_role
  common_name           = each.value.common_name
  ttl                   = each.value.ttl
  auto_renew            = true
  min_seconds_remaining = ceil(each.value.ttl / 3)
  alt_names             = each.value.alt_names
}

Debug Output

2023-08-14T15:38:53.408+0200 [INFO]  provider.terraform-provider-vault_v3.17.0_x5: 2023/08/14 15:38:53 [WARN] Failed to check if mount "pki_foo" exist, preempting the read operation: timestamp=2023-08-14T15:38:53.407+0200

Expected Behavior

Logs are captured by Terraform under the correct logging level WARN.

Actual Behavior

Due to the prefixed timestamp, Terraform fails to parse the logging level and the warning message is silently swallowed under INFO level. The provider should strip any prefixed date or time stamp before emitting the log or upgrade the logger:

log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))

References

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 a pull request may close this issue.

1 participant