Help Center/ Blockchain Service/ User Guide (ME-Abu Dhabi Region)/ FAQs/ BCS FAQs/ Chaincode Management/ How Do I View Chaincode Logs If My BCS Instance Uses Fabric v2.2?
Updated on 2023-03-02 GMT+08:00

How Do I View Chaincode Logs If My BCS Instance Uses Fabric v2.2?

Symptom

Chaincode container logs of a Fabric v2.2 BCS instance cannot be found on the AOM console.

Root Cause

Currently, non-Fabric-v2.2 BCS instances use Kubernetes to start chaincode containers, whereas Fabric v2.2 BCS instances use Docker. The use of Docker is consistent with the open-source Hyperledger practice, and improves the stability of chaincode containers. On the AOM console, only the log files of the chaincode containers started using Kubernetes are displayed. Therefore, you cannot view the log files of chaincode containers started using Docker.

Solution

To enable users to view chaincode logs on the AOM console for troubleshooting, BCS outputs the run logs of a chaincode to the run logs of the peer where the chaincode is installed.

Search the peer logs for the keyword [peer.chaincode.dev-peer-Organization ID-Peer ID-Chaincode Name-Chaincode Version]. For example, you can search for the keyword [peer.chaincode.dev-peer-964fe19e96d4e28ffc5dd590fd232d6a062e6fea-0-benchmark-1.0] to find the corresponding chaincode log, as shown in the following figure:

Figure 1 Chaincode logs