Updated on 2023-09-19 GMT+08:00

Viewing O&M Logs

Introduction

If an exception occurs when you use a BCS instance, view the O&M logs to analyze and locate the fault for quick rectification. This section describes how to view the O&M logs of each BCS instance node in the CCE cluster on the frontend GUI and backend virtual machines (VMs).

Table 1 BCS instance logs

Component

Description

Log Path

baas-agent

Blockchain management run log

/var/paas/sys/log/baas-agent/baas-agent.log

/var/paas/sys/log/baas-agent/audit.log

peer

Peer run log

/var/paas/sys/log/baas-service/peer/audit.peer-******-*.log

/var/paas/sys/log/baas-service/peer/peer-******-*.trace

orderer

Orderer run log

/var/paas/sys/log/baas-service/orderer/audit.orderer-******-*.log

/var/paas/sys/log/baas-service/orderer/orderer-******-*-start.trace

/var/paas/sys/log/baas-service/orderer/orderer-******-*.trace

Viewing Logs on the Frontend GUI

  1. View and record the node name on the Workloads page of the CCE console.

    1. Choose Workloads > Deployments, click the cluster where the BCS instance is deployed. View and record the name of the baas-agent node, for example, baas-agent.
      Figure 1 Checking baas-agent node name
    2. Choose Workloads > StatefulSets, click the cluster where the BCS instance is deployed. View and record the orderer and peer node names, for example, peer-xx.
      Figure 2 Checking peer and orderer nodes

  2. Go to the AOM console to view logs.

    1. In the navigation pane on the left of the AOM console, choose Log > Log Files, and select the cluster where the BCS instance is located.
    2. Select a recorded node name, and click View in the Operation column to view the node logs.
    3. Click Enable Real-Time Viewing. Then, you can view O&M logs of the node in real time.

Viewing O&M Logs on a Backend VM

  1. On the CCE console, view and record the node name on the Workloads page. For details, see Viewing Logs on the Frontend GUI.
  2. On the Instance Management page of the BCS console, locate the instance and choose More > Change Access Address to view the access address.

    Figure 3 Changing the blockchain network access address
    Figure 4 Viewing the access address

    The node where the BCS instance is deployed must be bound with an EIP.

  3. Log in to the VM corresponding to the access address, and view the O&M logs.

    Figure 5 Logging to the VM
    Enter the VM address (the access address obtained in 2) for Remote host, and enter the VM username for Specify username.
    1. Check baas-agent node logs.
      1. Run the following command to query the baas-agent node ID:
        docker ps|grep baas-agent
        Figure 6 Checking the baas-agent node ID
      2. Run the following command to query the baas-agent node logs:
        docker logs ID -f
        Figure 7 Checking the baas-agent node logs
    2. Check the logs of a peer node.
      1. Run the following command to query the peer node ID:
        docker ps|grep peer 
        Figure 8 Checking the peer ID
      2. Run the following command to query the peer node logs:
        docker logs -f ID  
        Figure 9 Checking the peer logs
    3. Check the logs of an orderer node.
      1. Run the following command to query the orderer ID:
        docker ps|grep orderer 
        Figure 10 Checking the orderer ID
      2. Run the following command to query the orderer logs:
        docker logs -f ID  
        Figure 11 Checking the orderer logs