

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Chef 日誌
<a name="troubleshoot-debug-log"></a>

**重要**  
 AWS OpsWorks Stacks 此服務已於 2024 年 5 月 26 日終止，並已針對新客戶和現有客戶停用。我們強烈建議客戶盡快將其工作負載遷移至其他解決方案。如果您對遷移有任何疑問，請透過 [AWS re：Post](https://repost.aws/) 或透過 [AWS Premium Support](https://aws.amazon.com/support) 聯絡 AWS 支援 團隊。

Chef 日誌是您的關鍵疑難排解資源之一，特別是用於偵錯配方。 OpsWorks Stacks 會擷取每個命令的 Chef 日誌，並保留執行個體最近 30 個命令的日誌。由於執行處於除錯模式，因此日誌內含 Chef 執行的詳細說明，包括傳送到 `stdout` 和 `stderror` 的文字。如果配方失敗，日誌會包含 Chef 堆疊追蹤。

OpsWorks Stacks 提供數種檢視 Chef 日誌的方式。一旦您擁有日誌資訊，就可用其為失敗配方除錯。

**注意**  
您也可以透過使用 SSH 連線到執行個體並執行代理程式 CLI `show_log` 命令，來檢視指定日誌的結尾。如需詳細資訊，請參閱[顯示 Chef 日誌](troubleshoot-debug-cli.md#troubleshoot-debug-cli-log)。

**Topics**
+ [

## 使用主控台檢視 Chef 日誌
](#troubleshoot-debug-log-console)
+ [

## 使用 CLI 或 API 檢視 Chef 日誌
](#troubleshoot-debug-log-cli)
+ [

## 在執行個體上檢視 Chef 日誌
](#troubleshoot-debug-log-instance)
+ [

## 解讀 Chef 日誌
](#troubleshoot-debug-log-interpret)
+ [

## 常見的 Chef 日誌錯誤
](#troubleshoot-debug-log-errors)

## 使用主控台檢視 Chef 日誌
<a name="troubleshoot-debug-log-console"></a>

檢視 Chef 日誌最簡單的方法是前往執行個體的詳細資訊頁面。**Logs (日誌)** 區段包含每個事件和[執行配方](workingstacks-commands.md)命令的進入點。下圖為執行個體的 **Logs (日誌)** 區段，顯示的內容是 **configure (設定)** 和 **setup (安裝)** 命令的日誌，兩者分別對應到設定和安裝生命週期事件。

![\[Logs section showing configure and setup commands with timestamps and durations.\]](http://docs.aws.amazon.com/zh_tw/opsworks/latest/userguide/images/gs11.png)


按一下適當命令的**日誌**欄中的**顯示**，以檢視對應的 Chef 日誌。如果發生錯誤， OpsWorks Stacks 會自動將日誌開啟為錯誤，通常位於檔案結尾。

## 使用 CLI 或 API 檢視 Chef 日誌
<a name="troubleshoot-debug-log-cli"></a>

您可以使用 OpsWorks Stacks CLI [https://docs.aws.amazon.com/cli/latest/reference/opsworks/describe-commands.html](https://docs.aws.amazon.com/cli/latest/reference/opsworks/describe-commands.html)命令或 [https://docs.aws.amazon.com/opsworks/latest/APIReference/API_DescribeCommands.html](https://docs.aws.amazon.com/opsworks/latest/APIReference/API_DescribeCommands.html) API 動作來檢視存放在 Amazon S3 儲存貯體上的日誌。以下說明如何使用 CLI 檢視指定執行個體目前任一組日誌檔案。使用 `DescribeCommands` 的程序基本上很類似。

**使用 OpsWorks Stacks 檢視執行個體的 Chef 日誌**

1. 開啟執行個體的詳細資訊頁面，並複製其 **OpsWorks ID** 值。

1. 使用此 ID 值執行 `describe-commands` CLI 命令，如下所示：

   ```
   aws opsworks describe-commands --instance-id 67bf0da2-29ed-4217-990c-d895d51812b9
   ```

   該命令會針對 OpsWorks Stacks 在執行個體上執行的每個命令，傳回具有內嵌物件的 JSON 物件，並以最新的先到者為準。`Type` 參數包含每個內嵌物件的命令類型，在此範例中為 `configure` 命令和 `setup` 命令。

   ```
   {
       "Commands": [
           {
               "Status": "successful",
               "CompletedAt": "2013-10-25T19:38:36+00:00",
               "InstanceId": "67bf0da2-29ed-4217-990c-d895d51812b9",
               "AcknowledgedAt": "2013-10-25T19:38:24+00:00",
               "LogUrl": "https://s3.amazonaws.com/prod_stage-log/logs/b6c402df-5c23-45b2-a707-ad20b9c5ae40?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
   &Expires=1382731518&Signature=YkqS5IZN2P4wixjHwoC3aCMbn5s%3D&response-cache-control=private&response-content-encoding=gzip&response-content-
   type=text%2Fplain",
               "Type": "configure",
               "CommandId": "b6c402df-5c23-45b2-a707-ad20b9c5ae40",
               "CreatedAt": "2013-10-25T19:38:11+00:00",
               "ExitCode": 0
           },
           {
               "Status": "successful",
               "CompletedAt": "2013-10-25T19:31:08+00:00",
               "InstanceId": "67bf0da2-29ed-4217-990c-d895d51812b9",
               "AcknowledgedAt": "2013-10-25T19:29:01+00:00",
               "LogUrl": "https://s3.amazonaws.com/prod_stage-log/logs/2a90e862-f974-42a6-9342-9a4f03468358?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
   &Expires=1382731518&Signature=cxKYHO8mCCd4MvOyFb6ywebeQtA%3D&response-cache-control=private&response-content-encoding=gzip&response-content-
   type=text%2Fplain",
               "Type": "setup",
               "CommandId": "2a90e862-f974-42a6-9342-9a4f03468358",
               "CreatedAt": "2013-10-25T19:26:01+00:00",
               "ExitCode": 0
           }
       ]
   }
   ```

1. 將 `LogUrl` 值複製到瀏覽器以檢視日誌。

如果執行個體具有多個命令，您可以將參數新增至 `describe-commands`，篩選出哪些命令應包含在回應物件中。如需詳細資訊，請參閱 [describe-commands](https://docs.aws.amazon.com/cli/latest/reference/opsworks/describe-commands.html)。

## 在執行個體上檢視 Chef 日誌
<a name="troubleshoot-debug-log-instance"></a>

**注意**  
本節中的主題適用於 Chef 12。如需 Chef 11.10 和較舊版 Chef 日誌位置的資訊，請參閱[為 Linux 的 Chef 11.10 和更舊版本進行故障診斷](https://docs.aws.amazon.com/opsworks/latest/userguide/troubleshooting-chef-11-linux.html)。

### Linux 執行個體
<a name="troubleshoot-debug-log-instance-linux"></a>

OpsWorks Stacks 會將每個執行個體的 Chef 日誌存放在其`/var/chef/runs`目錄中。(對於 Linux 執行個體，此目錄也包含相關聯的[資料包](data-bags.md)，其以 JSON 格式的檔案存放)。您需要 [sudo 權限](opsworks-security-users.md)才能存取此目錄。每個執行的日誌位於個別執行子目錄中名為 `chef.log` 的檔案。

OpsWorks Stacks 會將其內部日誌存放在執行個體的 `/var/log/aws/opsworks` 資料夾中。此資訊通常對故障診斷的幫助不大。不過，這些日誌對於 OpsWorks Stacks 支援很有用，如果您遇到服務問題，可能會要求您提供這些日誌。Linux 日誌有時也可提供有用的故障診斷資料。

### Windows 執行個體
<a name="troubleshoot-debug-log-instance-windows"></a>

**代理程式日誌**  
在 Windows 執行個體上，OpsWorks 日誌存放於 `ProgramData` 路徑，如下所示。數字會包含時間戳記。

```
C:\ProgramData\OpsWorksAgent\var\logs\number
```

**注意**  
根據預設，`ProgramData` 是隱藏的資料夾。若要將其取消隱藏，請導覽至 **Folder Options (資料夾選項)**。在 **View (檢視)** 下，選擇顯示隱藏檔案的選項。

下列範例示範 Windows 執行個體上的代理程式日誌。

```
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         5/24/2015  11:59 PM     127277 command.20150524.txt
-a---         5/25/2015  11:59 PM     546772 command.20150525.txt
-a---         5/26/2015  11:59 PM     551514 command.20150526.txt
-a---         5/27/2015   9:43 PM     495181 command.20150527.txt
-a---         5/24/2015  11:59 PM      24353 keepalive.20150524.txt
-a---         5/25/2015  11:59 PM     106232 keepalive.20150525.txt
-a---         5/26/2015  11:59 PM     106208 keepalive.20150526.txt
-a---         5/27/2015   8:54 PM      92593 keepalive.20150527.txt
-a---         5/24/2015   7:19 PM       3891 service.20150524.txt
-a---         5/27/2015   8:54 PM       1493 service.20150527.txt
-a---         5/24/2015  11:59 PM     112549 wire.20150524.txt
-a---         5/25/2015  11:59 PM     501501 wire.20150525.txt
-a---         5/26/2015  11:59 PM     499640 wire.20150526.txt
-a---         5/27/2015   8:54 PM     436870 wire.20150527.txt
```

**Chef 日誌**  
在 Windows 執行個體上，Chef 日誌存放於 `ProgramData` 路徑，如下所示。數字會包含時間戳記。

```
C:\ProgramData\OpsWorksAgent\var\commands\number
```

**注意**  
此目錄僅包含第一個 (OpsWorks 擁有的) Chef 執行的輸出。

下列範例示範 Windows 執行個體上 OpsWorks 擁有的 Chef 日誌。

```
 Mode                LastWriteTime            Name
 ----                -------------            ----
 d----         5/24/2015   7:23 PM            configure-7ecb5f47-7626-439b-877f-5e7cb40ab8be
 d----         5/26/2015   8:30 PM            configure-8e74223b-d15d-4372-aeea-a87b428ffc2b
 d----         5/24/2015   6:34 PM            configure-c3980a1c-3d08-46eb-9bae-63514cee194b
 d----         5/26/2015   8:32 PM            grant_remote_access-70dbf834-1bfa-4fce-b195-e50e85402f4c
 d----         5/26/2015  10:30 PM            revoke_remote_access-1111fce9-843a-4b27-b93f-ecc7c5e9e05b
 d----         5/24/2015   7:21 PM            setup-754ec063-8b60-4cd4-b6d7-0e89d7b7aa78
 d----         5/26/2015   8:27 PM            setup-af5bed36-5afd-4115-af35-5766f88bc039
 d----         5/24/2015   6:32 PM            setup-d8abeffa-24d4-414b-bfb1-4ad07319f358
 d----         5/24/2015   7:13 PM            shutdown-c7130435-9b5c-4a95-be17-6b988fc6cf9a
 d----         5/26/2015   8:25 PM            sync_remote_users-64c79bdc-1f6f-4517-865b-23d2def4180c
 d----         5/26/2015   8:48 PM            update_custom_cookbooks-2cc59a94-315b-414d-85eb-2bdea6d76c6a
```

**使用者 Chef 日誌**  
您可以在名為 `logfile.txt` 的檔案中找到您 Chef 執行的日誌，該檔案則位於以編號之 Chef 命令命名的資料夾中，如下圖所示。

 C:/chef └── `runs` └── `command-12345` ├── `attribs.json` ├── `client.rb` └── `logfile.txt` 

## 解讀 Chef 日誌
<a name="troubleshoot-debug-log-interpret"></a>

日誌的開頭主要包含內部 Chef 記錄。

```
# Logfile created on Thu Oct 17 17:25:12 +0000 2013 by logger.rb/1.2.6
[2013-10-17T17:25:12+00:00] INFO: *** Chef 11.4.4 ***
[2013-10-17T17:25:13+00:00] DEBUG: Building node object for php-app1.localdomain
[2013-10-17T17:25:13+00:00] DEBUG: Extracting run list from JSON attributes provided on command line
[2013-10-17T17:25:13+00:00] INFO: Setting the run_list to ["opsworks_custom_cookbooks::load", "opsworks_custom_cookbooks::execute"] from JSON
[2013-10-17T17:25:13+00:00] DEBUG: Applying attributes from json file
[2013-10-17T17:25:13+00:00] DEBUG: Platform is amazon version 2013.03
[2013-10-17T17:25:13+00:00] INFO: Run List is [recipe[opsworks_custom_cookbooks::load], recipe[opsworks_custom_cookbooks::execute]]
[2013-10-17T17:25:13+00:00] INFO: Run List expands to [opsworks_custom_cookbooks::load, opsworks_custom_cookbooks::execute]
[2013-10-17T17:25:13+00:00] INFO: Starting Chef Run for php-app1.localdomain
[2013-10-17T17:25:13+00:00] INFO: Running start handlers
[2013-10-17T17:25:13+00:00] INFO: Start handlers complete.
[2013-10-17T17:25:13+00:00] DEBUG: No chefignore file found at /opt/aws/opsworks/releases/20131015111601_209/cookbooks/chefignore no files will be ignored
[2013-10-17T17:25:13+00:00] DEBUG: Cookbooks to compile: ["gem_support", "packages", "opsworks_bundler", "opsworks_rubygems", "ruby", "ruby_enterprise", "dependencies", "opsworks_commons", "scm_helper", :opsworks_custom_cookbooks]
[2013-10-17T17:25:13+00:00] DEBUG: Loading cookbook gem_support's library file: /opt/aws/opsworks/releases/20131015111601_209/cookbooks/gem_support/libraries/current_gem_version.rb
[2013-10-17T17:25:13+00:00] DEBUG: Loading cookbook packages's library file: /opt/aws/opsworks/releases/20131015111601_209/cookbooks/packages/libraries/packages.rb
[2013-10-17T17:25:13+00:00] DEBUG: Loading cookbook dependencies's library file: /opt/aws/opsworks/releases/20131015111601_209/cookbooks/dependencies/libraries/current_gem_version.rb
[2013-10-17T17:25:13+00:00] DEBUG: Loading cookbook opsworks_commons's library file: /opt/aws/opsworks/releases/20131015111601_209/cookbooks/opsworks_commons/libraries/activesupport_blank.rb
[2013-10-17T17:25:13+00:00] DEBUG: Loading cookbook opsworks_commons's library file: /opt/aws/opsworks/releases/20131015111601_209/cookbooks/opsworks_commons/libraries/monkey_patch_chefgem_resource.rb
...
```

檔案的這一部分對 Chef 專家來說非常有用。請注意，即使大多數命令包含更多配方，執行清單僅含兩個配方。這兩個配方處理載入和執行其他所有內建和自訂配方的任務。

檔案最有趣的部分通常在結尾。如果執行成功結束，您應該會看到類似以下的內容：

```
...
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: STDERR: 
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: ---- End output of /sbin/service mysqld restart ----
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: Ran /sbin/service mysqld restart returned 0
[Tue, 11 Jun 2013 16:00:50 +0000] INFO: service[mysql]: restarted successfully
[Tue, 11 Jun 2013 16:00:50 +0000] INFO: Chef Run complete in 84.07096 seconds
[Tue, 11 Jun 2013 16:00:50 +0000] INFO: cleaning the checksum cache
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: removing unused checksum cache file /var/chef/cache/checksums/chef-file--tmp-chef-rendered-template20130611-4899-8wef7e-0
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: removing unused checksum cache file /var/chef/cache/checksums/chef-file--tmp-chef-rendered-template20130611-4899-1xpwyb6-0
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: removing unused checksum cache file /var/chef/cache/checksums/chef-file--etc-monit-conf
[Tue, 11 Jun 2013 16:00:50 +0000] INFO: Running report handlers
[Tue, 11 Jun 2013 16:00:50 +0000] INFO: Report handlers complete
[Tue, 11 Jun 2013 16:00:50 +0000] DEBUG: Exiting
```

**注意**  
您可以使用代理程式 CLI 在執行期間或結束後顯示日誌結尾。如需詳細資訊，請參閱[顯示 Chef 日誌](troubleshoot-debug-cli.md#troubleshoot-debug-cli-log)。

如果配方失敗，您應該尋找 ERROR 層級的輸出，該輸出將包含例外狀況，並接續著 Chef 堆疊追蹤，如下所示：

```
...
Please report any problems with the /usr/scripts/mysqlbug script!

[  OK  ]
MySQL Daemon failed to start.
Starting mysqld:  [FAILED]STDERR: 130611 15:07:55 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
130611 15:07:56 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
---- End output of /sbin/service mysqld start ----

/opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/mixin/command.rb:184:in `handle_command_failures'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/mixin/command.rb:131:in `run_command'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/provider/service/init.rb:37:in `start_service'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/provider/service.rb:60:in `action_start'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource.rb:406:in `send'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource.rb:406:in `run_action'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/runner.rb:53:in `run_action'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/runner.rb:89:in `converge'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/runner.rb:89:in `each'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/runner.rb:89:in `converge'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/runner.rb:84:in `converge'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/client.rb:268:in `converge'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/client.rb:158:in `run'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/application/solo.rb:190:in `run_application'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/application/solo.rb:181:in `loop'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/application/solo.rb:181:in `run_application'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/../lib/chef/application.rb:62:in `run'
  /opt/aws/opsworks/releases/20130605160141_122/vendor/bundle/ruby/1.8/gems/chef-0.9.15.5/bin/chef-solo:25
  /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
  /opt/aws/opsworks/current/bin/chef-solo:16
```

檔案的結尾是 Chef 堆疊追蹤。您也應該檢查例外狀況之前的輸出，通常包含系統錯誤 (例如 `package not available`)，這在故判斷失敗原因時也很有用。在此範例中，MySQL 協助程式無法啟動。

## 常見的 Chef 日誌錯誤
<a name="troubleshoot-debug-log-errors"></a>

下列是一些常見的 Chef 日誌錯誤及其解決方法。

找不到日誌  
在 Chef 執行開始時，執行個體會收到預先簽章的 Amazon S3 URL，可讓您在 Chef 執行完成時在網頁上檢視日誌。由於此 URL 會在兩個小時後過期，因此如果 Chef 執行需要超過兩個小時，即使 Chef 執行期間沒有發生任何問題，也不會將日誌上傳至 Amazon S3 網站。建立日誌的命令會成功，但僅可在執行個體上檢視日誌，而不能在預先簽章的 URL 上檢視。

日誌意外結束  
如果 Chef 日誌意外結束，並未指出成功或顯示錯誤資訊，您可能發生記憶體低下的狀態，讓 Chef 無法完成日誌。最佳選項就是使用更大的執行個體重試。

缺少技術指南或配方  
如果 Chef 執行發生技術指南或配方不在技術指南快取內的情況，您將看到類似以下的內容：  

```
DEBUG: Loading Recipe mycookbook::myrecipe via include_recipe  
ERROR: Caught exception during execution of custom recipe: mycookbook::myrecipe:
   Cannot find a cookbook named mycookbook; did you forget to add metadata to a cookbook?
```
此項目指出 `mycookbook` 技術指南不在技術指南快取內。使用 Chef 11.4 時，如果您未在 `metadata.rb` 中正確宣告相依性，也可能發生此錯誤。  
OpsWorks Stacks 會從執行個體的技術指南快取執行配方。其會在執行個體啟動時，將儲存庫中的技術指南下載到此快取中。不過，如果您後續修改儲存庫中的技術指南， OpsWorks Stacks 不會自動更新線上執行個體上的快取。如果您在執行個體啟動後，修改技術指南或新增技術指南，請執行以下步驟：  

1. 確定您已將變更遞交到儲存庫。

1. 執行[更新技術指南堆疊命令](workingstacks-commands.md)，以使用儲存庫中的最新版本來更新技術指南快取。

本機命令失敗  
如果 Chef `execute` 資源無法執行指定命令，您將會看到類似以下的內容：  

```
DEBUG: ---- End output of ./configure --with-config-file-path=/ returned 2 
ERROR: execute[PHP: ./configure] (/root/opsworks-agent/site-cookbooks/php-fpm/recipes/install.rb line 48) had an error:
   ./configure --with-config-file-path=/
```
向上捲動日誌，您應該會看到命令的 `stderr` 和 `stdout` 輸出，這有助您判斷命令失敗的原因。

套件失敗  
如果套件安裝失敗，您將會看到類似以下的內容：  

```
ERROR: package[zend-server-ce-php-5.3] (/root/opsworks-agent/site-cookbooks/zend_server/recipes/install.rb line 20)
   had an error: apt-get -q -y --force-yes install zend-server-ce-php-5.3=5.0.4+b17 returned 100, expected 0
```
向上捲動日誌，您應該會看到命令的 STDOUT 和 STDERROR 輸出，這有助您判斷套件安裝失敗的原因。