This topic describes the log files, log levels, and log-related parameters in OceanBase Database Proxy (ODP).
Log files
ODP log files are stored in the log folder under the ODP installation directory. The following table describes the log files that require your attention.
| File name | Description |
|---|---|
| obproxy_diagnosis.log | Records ODP diagnostic information in aspects of logon, startup, connection, and routing. |
| obproxy_digest.log | Records information about SQL queries whose execution time exceeds query_digest_time_threshold and SQL queries that failed to be executed. |
| obproxy_error.log | Records information about SQL queries that failed to be executed. |
| obproxy_slow.log | Records information about slow SQL queries. |
| obproxy_stat.log | Records SQL execution statistics over a period of time. |
| obproxy_trace.log | Records end-to-end diagnostic information. |
| obproxy.log | Records detailed ODP information. This file is the most comprehensive one. |
Log levels
ODP supports seven log levels, as described in the following table.
Note
The log levels are ranked in descending order in the table.
| Log level | Description |
|---|---|
| ERROR | Logs at this level record serious errors in ODP. In this case, troubleshooting must be performed, or the system will become unavailable. |
| WARN | Logs at this level record unexpected scenes. In this case, ODP can continue to provide services but may not behave as expected, or serious errors may occur, so troubleshooting is required. |
| INFO | Logs at this level record information about system changes. Such information represents the current operation status of the system. |
| EDIAG | Logs at this level record error diagnosis, which can be used for troubleshooting and are unexpected logic errors. |
| WDIAG | Logs at this level record warning diagnosis, which can be used for troubleshooting and are expected errors. |
| TRACE | Logs at this level record task-level debugging information. |
| DEBUG | Logs at this level record detailed debugging information. |
You can use the show proxyconfig command to view the level of system logs (syslog_level) or that of monitoring logs (monitor_log_level). By default, system logs are printed at the WDIAG level and monitoring logs are printed at the INFO level.
obclient > show proxyconfig like '%log_level%';
The return result is as follows:
+-------------------+-------+-------------------------------------------------------------------------------------------------+-------------+---------------+
| name | value | info | need_reboot | visible_level |
+-------------------+-------+-------------------------------------------------------------------------------------------------+-------------+---------------+
| xflush_log_level | ERROR | specifies the current level of logging: DEBUG, TRACE, INFO, WDIAG, EDIAG, WARN, ERROR | false | USER |
| monitor_log_level | INFO | specifies the current level of logging: DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR | false | USER |
| syslog_level | WDIAG | specifies the current level of logging: DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR | false | USER |
+-------------------+-------+-------------------------------------------------------------------------------------------------+-------------+---------------+
Related parameters
The following table describes the log-related parameters in ODP.
| Parameter | Description |
|---|---|
| log_file_percentage | Specifies the maximum percentage of available space occupied by log files of ODP. |
| log_dir_size_threshold | Specifies the maximum available space of the directory where ODP logs are stored. |
| syslog_io_bandwidth_limit | Specifies the maximum disk I/O bandwidth available to ODP logs. |
| enable_syslog_wf | Specifies whether to print logs at or above the WARN level in obproxy.log to a separate log file (obproxy.log.wf). |
| max_log_file_size | Specifies the maximum size of a single log file in ODP. |
| log_cleanup_interval | Specifies the interval for clearing log files. |
| max_syslog_file_time | Specifies the maximum retention period of archive logs. |
| max_syslog_file_count | Specifies the maximum number of archive log files that can be retained. |
| enable_syslog_file_compress | Specifies whether to enable compression for archive logs. |
| syslog_level | Specifies the system log (obproxy.log) level. |
| monitor_log_level | Specifies the monitoring log level. |
| enable_async_log | Specifies whether to enable asynchronous logs. |
You can run the following command to modify these parameters. For more information, see View and modify parameters.
ALTER proxyconfig SET <var_name> = <var_value>