我以前terraform plan使用 unix 輸出重定向成功地將輸出捕獲到檔案中,如下所示:
tf plan -no-color > plan.txt
當我的plan(或apply)有錯誤時,盡管我在終端輸出中看到錯誤訊息,但輸出文本檔案是空的。
即使在出現錯誤的情況下,我如何捕獲輸出?
uj5u.com熱心網友回復:
如果要重定向所有內容,可以執行以下操作:
tf plan -no-color > plan.txt 2>&1
uj5u.com熱心網友回復:
Terraform 有一個內置變數TF_LOG_PATH,可將所有輸出(包括錯誤)重定向到特定檔案。您不需要重定向輸出。
例子:
export TF_LOG_PATH=/mydirectory/mylogfile.log
terraform plan
來源:https : //www.terraform.io/docs/internals/debugging.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/365013.html
上一篇:如何等待所有Promise完成
下一篇:在Tkinter中隱藏元素
