8 Monitor and Troubleshoot Your Instance
Topics
Logging
- v19.3.2 Instance Logs
- v19.3.3 - 19.3.5 Instance Logs
- v19.3.2 to v19.3.3 Migrated Instance Logs
- v21.1.2 Instance Logs
- Blockchain Platform Manager Logs
- Set the Log Level for Component Manager
- Set the Log Level for the Instance Service
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 - 19.3.5 Instance Logs
/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 islocal6
. -
logrotateday(numeric)
is the log rotation days before expired data could be removed. Default is7
.
Example:
./config-syslog.sh -s syslog.server.example.com -d /u01/obp-logs -r 10
v19.3.2 to 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
/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 islocal6
. -
logrotateday(numeric)
is the log rotation days before expired data could be removed. Default is7
.
Example:
./config-patch.sh -s syslog.server.example.com -d /u01/obp-logs -r 10
v21.1.2 Instance Logs
The default location of the logs in this release is /u01/obp-logs
.
For instances upgraded from earlier versions, this is configured as described in Configure Raft Consensus Protocol.
Blockchain Platform Manager Logs
/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
- Log in to your virtual machine
- Open
/home/oracle/startcm.sh
in an editor. - Add the following line next to the line starting with
docker run
:
where the supported log levels are-e "BCS_LOG_LEVEL=DEBUG" \
ERROR
,WARNING
,INFO
, andDEBUG
. - 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
- Find your node manager service name:
docker service ls
- Use the following Docker command:
where the supported log levels aredocker service update --env-add BCS_LOG_LEVEL=DEBUG <NM_service_name>
ERROR
,WARNING
,INFO
, andDEBUG
.
For node manager on the VM, you can use the environment variable BCS_LOG_LEVEL
to set the log level.