This topic describes how to download logs.
Access paths
You can access the Log Search page from the following paths and specify the search criteria to download required logs:
On the Overview page of a cluster, hover over the More icon in the upper-right corner and select Download Logs from the drop-down list.
On the Overview page of an OBProxy cluster, hover over the More icon in the upper-right corner and select Download All Logs from the drop-down list.
On the Basic Information tab of the host details page, click Download Logs.
On the Log Query page of Log Service, click Download Logs in the upper-right corner of the log query result.
Specify the time range
You can select last 5, 10, 15, or 30 minutes, last 1, 3, 6, 12, or 24 hours, or last 7 days from the current time, or specify a time range, to download logs generated within the specified time range.
Specify the object scope
You can view the logs of an OceanBase cluster, an arbitration service, an OBProxy cluster, a binlog server, a binlog instance, or a host.
Specify the log type
The following table describes the log types.
| Log type | Description |
|---|---|
| OceanBase Database logs | All logs in the /log/ directory of the OceanBase cluster installation path, subdivided into four types: observer, rootservice, election, and alert. The log clearing strategy is determined by the value you specified for the ocp.agent.ob-cleaner.config parameter:
|
| Arbitration service logs | All logs in the /log/ directory of the arbitration service installation path, subdivided into three types: arbitration_observer, arbitration_rootservice, and arbitration_election. |
| OBProxy logs | All logs in the /home/admin/logs/obproxy/log/ directory, subdivided into eight types: obproxy, obproxy_digest, obproxy_stat, obproxy_slow, obproxy_limit, obproxy_diagnosis, obproxy_xflush, and obproxy_error. |
| Binlog server logs | All binlog_server_logproxy logs in the /log/ directory of the binlog cluster installation path. |
| Binlog instance logs | All logs in the /run/instance name/log/ directory of the binlog cluster installation path, subdivided into four types: binlog_service_instance, binlog_service_init, binlog_service_libobcdc, and binlog_service_libobcdc_stderr. |
| Host logs | All message-date files in the /var/log directory. |
| OCP Agent logs | All logs in the /home/admin/ocp_agent/log/ directory, subdivided into four types: mgragent, monagent, agentctl, and agentd. |
Specify the keywords
You can specify one or more keywords in the Include or Exclude search box for case-insensitive exact match during log filtering. This operation is optional.
- Specify keywords in the Include search box: Logs containing the keywords will be returned during log search. Regular expression matching and general matching of multiple keywords are supported.
- Specify keywords in the Exclude search box: Logs containing the keywords will be filtered out during log search. Multiple keywords can be excluded.
Specify the log level
You can select an alert level from the drop-down list. Seven alert levels are available: ERROR, WARN, INFO, WDIAG, EDIAG, TRACE, and DEBUG. This operation is optional.