7 Monitor and Troubleshoot Your Instance

Topics

Logging

v19.3.2 Instance Logs

After Oracle Blockchain Platform has started successfully, a container log will be written to /u01/obp-logs when its size reaches 10MB.You can check the current logs in the docker containers using docker commands.

Upon failure of provisioning, in most cases you would want to use a docker command to check the container status and logs, such as docker ps, docker inspect, docker service ls, and docker service ps. Logs will not be found under /u01/obp-logs because either the container creation failed in the middle of the docker daemon preparing the container, control has not been transferred to ENTRYPOINT command, or the container has exited due to error condition before the log reached 10MB.

v19.3.3 New Instance Logs

When an instance is created in Oracle Blockchain Platform Enterprise Edition v19.3.3 or later, all service logs are output to your local VM syslog; the default is /var/log/messages. To configure the logging, as root go to /u01/blockchain/tools. The config-syslog.sh script is used to:
  • define the syslog server
  • define the server log location if you don't want to use /var/log/messages
  • define the log rotation cycle
$ ./config-syslog.sh -h 
Syslog config: main entry 
Usage: ./config-syslog.sh -s logserveraddr [-d logserverdir] [-f syslogfacility] [-r logrotateday]
  • logserveraddr is the remote rsyslog server address. Its value should be the output of <platformhost.com>
  • logserverdir is the log output directory on logserver. Default is /u01/obp-logs.
  • syslogfacility is the syslog facility value. Default is local6.
  • logrotateday(numeric) is the log rotation days before expired data could be removed. Default is 7.

Example:


./config-syslog.sh -s syslog.server.example.com -d /u01/obp-logs -r 10

v19.3.3 Migrated Instance Logs

Because log collection was introduced in v19.3.3, instances created in 19.3.2 and patched to 19.3.3 are still using docker container logs; the default location is /var/lib/docker/containers/<CID>/<CID>-json.log

If you want to configure log collection, as root go to /u01/blockchain/tools and run config-patch.sh. This script is used to:
  • define the syslog server
  • define the server log location if you don't want to use /var/log/messages
  • define the log rotation cycle
$ ./config-patch.sh -h Patch config: main entry  Usage:
    ./config-patch.sh -s logserveraddr [-d logserverdir] [-f syslogfacility] [-r logrotateday]
  • logserveraddr is the remote rsyslog server address. Its value should be the output of <platformhost.com>
  • logserverdir is the log output directory on logserver. Default is /u01/obp-logs.
  • syslogfacility is the syslog facility value. Default is local6.
  • logrotateday(numeric) is the log rotation days before expired data could be removed. Default is 7.

Example:


./config-patch.sh -s syslog.server.example.com -d /u01/obp-logs -r 10

Blockchain Platform Manager Logs

The following logs are available in /u01/blockchain/cp/logs/:
  • access.log: This log provides Blockchain Platform Manager access information for audit purposes. This log shows access information for all the REST resources (APIs) that have been accessed by a user while performing various activities. The user information is available only for the activities that are performed using the Blockchain Platform Manager Console.

Default location: /var/log/messages

But they can run script sudo /u01/blockchain/tools/config-syslog.sh -s `hostname` and instance log are output to default file /u01/obp-logs/obp.log

Set the Log Level for Component Manager

To set the log level for Component Manager:
  1. Log in to your virtual machine
  2. Open /home/oracle/startcm.sh in an editor.
  3. Add the following line next to the line starting with docker run:
    -e "BCS_LOG_LEVEL=DEBUG" \
    where the supported log levels are ERROR, WARNING, INFO, and DEBUG.
  4. Restart the component manager:
    sudo systemctl restart compmanager.service

For component manager on the VM, you can use the environment variable BCS_LOG_LEVEL to set the log level.

Set the Log Level for the Instance Service

To set the log level for the node manager:
  1. Find your node manager service name:
    docker service ls
  2. Use the following Docker command:
    docker service update --env-add BCS_LOG_LEVEL=DEBUG <NM_service_name>
    where the supported log levels are ERROR, WARNING, INFO, and DEBUG.

For node manager on the VM, you can use the environment variable BCS_LOG_LEVEL to set the log level.