追蹤是用來判定問題。追蹤可協助商店程式開發人員在開發階段中進行程式碼的除錯,也可協助技術支援小組解決客戶的問題。
追蹤以資料結構形式保存在追蹤檔中,供未來參考之用。 資料結構是由類別名稱、方法名稱和文字訊息這類環境定義資訊組成。 多重資料結構可說明軟體應用程式內的資料流程。 商店程式開發人員可以分析資料結構序列以瞭解所執行的路徑,進而判定故障的原因。
追蹤資料會根據元件過濾,且必須予以啟用。 追蹤架構是以 CommerceServer\instances\instance_name\xml\instance_name.xml 架構檔為基礎:
<LogSystem>
<trace traceFile="drive:\WebSphere\CommerceServer\instances\instance_name\logs\ecmsg.log"
<trace "drive:\WebSphere\CommerceServer\instances\instance_name\logs\ecmsg.log"
<trace traceFile="/usr/WebSphere/CommerceServer/instances/instance_name/logs/ecmsg.log"
traceFile="/opt/WebSphere/CommerceServer/instances/instance_name/logs/ecmsg.log"
<trace traceFile="/QIBM/UserData/WebCommerce/instances/instance_name/logs/ecmsg.log"
<LogSystem name="Log System">
<trace display="false"
fileSize="40"
traceFile="D:\WebSphere\CommerceServer\instances\demo\logs\ecmsg.log">
<component name="CATALOG" />
<component name="ORDER" />
<component name="COMMAND" />
<component name="STOREOPERATIONS" />
<component name="INVENTORY" />
</trace>
....
</LogSystem>
附註:如果要在載入時停用追蹤,請將 enable 屬性設為 false。
fileSize 屬性指定日誌檔的大小上限 (MB)。 如果實際檔案大小超出指定量時,會開啟一個新檔案,並由 traceFile 提供基本檔名。
檔名是根據下列的命名慣例建立而成: file name_clone ID_time stamp.ext。舉例來說,ecmsg.log 檔將產生像是 ecmsg_ploiesti_2000.08.08_18.17.47.768.log 名稱的系統檔; 其中 ploiesti 為複本 ID,而內嵌時間戳記為一個變數因數。
如果要架構 WebSphere Commerce 系統的追蹤,請使用架構管理程式的「日誌系統」畫面, 或管理主控台中的架構功能表其中的「追蹤」頁面。
![]() |