啟用記錄

WARNING
所有MagentoCLI指令都必須由 檔案系統擁有者.

偵錯記錄

依預設,Commerce會將寫入偵錯紀錄(<install_directory>/var/log/debug.log)處於預設或開發模式時,但處於生產模式時則不會。 使用 bin/magento setup:config:set --enable-debug-logging 命令來變更預設值。

INFO
自Commerce 2.3.1起,您將無法再使用 bin/magento config:set dev/debug/debug_logging 命令來啟用或停用目前模式的偵錯記錄。

啟用偵錯記錄

  1. 使用 setup:config:set 命令以啟用目前模式的偵錯記錄。

    code language-bash
    bin/magento setup:config:set --enable-debug-logging=true
    
  2. 排清快取。

    code language-bash
    bin/magento cache:flush
    

停用偵錯記錄

  1. 使用 setup:config:set 命令可停用目前模式的偵錯記錄。

    code language-bash
    bin/magento setup:config:set --enable-debug-logging=false
    
  2. 排清快取。

    code language-bash
    bin/magento cache:flush
    

資料庫記錄

依預設,Commerce會將資料庫活動記錄檔寫入 <install-dir>/var/debug/db.log 檔案。

啟用資料庫記錄

  1. 使用 dev:query-log 啟用或停用資料庫記錄的命令。

    code language-bash
    bin/magento dev:query-log:enable
    
    code language-bash
    bin/magento dev:query-log:disable
    
  2. 排清快取。

    code language-bash
    bin/magento cache:flush
    

Cron記錄

在版本2.3.1中,Commerce現在會建立個別的 cron 記錄。
Commerce最近讓cron記錄更詳細,這提供了更多資訊,但延長了 system.log 相當大。
移動 cron 將資訊新增至專用記錄檔可讓兩個記錄檔更容易閱讀。

依預設,Commerce會寫入 cron 資訊至 <install-directory>/var/log/cron.log 檔案。

Syslog記錄

依預設,Commerce會寫入 syslog 作業系統的記錄檔 syslog 檔案。
截至Commerce 2.3.1,您必須使用 magento 啟用或停用syslog的命令。
管理員中的設定已移除。

啟用syslog記錄

登入 syslog 預設為停用。

  1. 使用 setup:config:set 命令以變更 dev/syslog/syslog_logging 資料庫值至 true.

    code language-bash
    bin/magento setup:config:set --enable-syslog-logging=true
    
  2. 排清快取。

    code language-bash
    bin/magento cache:flush
    

停用syslog記錄

  1. 使用 setup:config:set 命令以變更 dev/syslog/syslog_logging 資料庫值至 false.

    code language-bash
    bin/magento setup:config:set --enable-syslog-logging=false
    
  2. 排清快取。

    code language-bash
    bin/magento cache:flush
    
recommendation-more-help
386822bd-e32c-40a8-81c2-ed90ad1e198c