Closed glebarez closed 1 month ago
I can take a look at this, it's not that trivial though. It will require changes to the code.
running packer directly, I can make it produce logs in a separate file by setting PACKER_LOG
and PACKER_LOG_PATH
env. variables. (see https://developer.hashicorp.com/packer/docs/v1.9.x/debugging#debugging-packer)
But if I pass it trough environment
block like this:
resource "packer_image" "my_image" {
file = data.packer_files.files1.file
environment = {
PACKER_LOG = "1"
PACKER_LOG_PATH = "/path/to/packer.log"
}
}
It seems to have no effect, somehow.
running packer directly, I can make it produce logs in a separate file by setting
PACKER_LOG
andPACKER_LOG_PATH
env. variables. (see https://developer.hashicorp.com/packer/docs/v1.9.x/debugging#debugging-packer)But if I pass it trough
environment
block like this:resource "packer_image" "my_image" { file = data.packer_files.files1.file environment = { PACKER_LOG = "1" PACKER_LOG_PATH = "/path/to/packer.log" } }
It seems to have no effect, somehow.
Not sure why this is the case as the env variables are passed here: https://github.com/toowoxx/terraform-provider-packer/blob/main/packer_interop/env.go#L21-L23
I fixed this in 0.16.0. Turns out there was an issue with how Packer was starting up. The routines that set up logging to files were not being run prior to 0.16.0.
Can you please suggest a recipe to tail packer output while terraform is working on it ?