Logging and monitoring overview
By default, the API Co-Signer uses the docker logging container. However, for better monitoring, the logs can be streamed to an external log delivery service, such as ELK, Splunk, or Datadog.
The API Co-Signer generates two different types of logs for troubleshooting and auditing:
- run.log is an automatically generated log containing all of your API Co-Signer setup and configuration history.
- customer_cosigner.log contains workspace operation data, such as the workspace's transaction approving and signing history and new connection approvals. These log files are separated into 10 files limited to 4.1MB each. They are automatically overwritten in chronological order.
Manually generating logs
First, run all commands from a user with root permission.
>sudo -i
To retrieve your API Co-Signer logs, run the following command:
./cosigner logs
Running the logs command writes logs to the /databases/cosigner/log
directory.
Alternatively, you can optionally enter a number to only output the specified most recent amount of lines like so: ./cosigner logs 10000
Log structure
Your API Co-Signer logs are structured using the following Regular Expression (RegEx):
${AppName}:${Line} ${LogLevel} ${dd/MM/yyyy} ${HH:mm:ss,fff} ${ClassName} ::${MethodName} - ${LogMessage}
These logs are collected by the docker container’s STDOUT stream and written into a log file on the container’s host machine at the location specified below. These log files are rotated with a max file size of 4MB for each log file.
/databases/cosigner/log/customer_cosigner.log
/databases/cosigner/log/customer_cosigner.log.1
/databases/cosigner/log/customer_cosigner.log.2
...
Note
The API Co-Signer is Docker-based and uses the Docker JSON file driver for logging. By default, the driver uses a standard logging output but can be configured to support other logging mechanisms. Learn more from the official Docker documentation.