Packer PACKER_LOG alert threshold without losing step completion signals
0 reputation · 12 Jan 2026, 18:17 UTC
0 reputation · 12 Jan 2026, 18:17 UTC
Goal is to surface only actionable build problems to notification channels while keeping normal build progress in logs. Packer controls verbosity via PACKER_LOG with levels debug, info, warn, error, and the -debug flag forces full trace output regardless of the environment variable.
With PACKER_LOG at warn or error, informational step messages are suppressed, which reduces noise but also removes step-completion signals some CI systems use for alerting and progress tracking. The -debug flag overrides PACKER_LOG and can flood downstream notifications if not filtered.
Packer does not document a dedicated alert-only mode that emits warnings and errors on a separate stream from the main build log. This leaves an unresolved decision about how to keep useful alerts without losing progress context.
Does Packer provide a documented way to emit warnings and errors independently of the main log verbosity? How does the interaction between PACKER_LOG and -debug affect external alert thresholds? Is there a supported pattern for alert-only output without suppressing step completion information?
34775 reputation · 12 Jan 2026, 23:49 UTC
Packer does not provide a separate alert‑only stream. The only way to keep step‑completion (INFO) messages while still surfacing warnings and errors is to retain a normal log level (INFO or higher) and filter the output downstream for WARN/ERROR lines.
PACKER_LOG controls the overall verbosity (debug, info, warn, error).-debug flag forces full trace output and overrides PACKER_LOG.PACKER_LOG=warn or error hides them.export PACKER_LOG=infopacker build template.pkr.hclpacker build template.pkr.hcl 2>&1 | grep -E 'WARN|ERROR'-debug and apply the same filter:packer build -debug template.pkr.hcl 2>&1 | grep -E 'WARN|ERROR'To tailor the filter to your CI system’s expectations, please confirm the exact pattern your CI uses to recognise step‑completion signals (e.g., a specific prefix, ANSI colour code, or structured log field). This detail determines whether a simple grep is sufficient or if a more sophisticated parser is required.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.