OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.6.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.6.0
    iconOceanBase Database
    SQL - V 4.6.0
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Log levels

    Last Updated:2026-05-07 11:26:24  Updated
    Share
    What is on this page
    Share

    OceanBase Database supports seven log levels. The following table describes the log levels in descending order.

    Log level
    Description
    ERROR Critical errors. Logs at this level record system failure information. The system is unavailable until the errors are handled.
    WARN Warnings. The system continues to provide services but may not as expected, or a serious error occurs and requires troubleshooting.
    INFO General information. Logs at this level record the current operation status of the system.
    EDIAG Error diagnosis information, which usually corresponds to a bug of OceanBase Database.
    WDIAG Warning diagnosis information indicating expected errors that OceanBase Database can tolerate.
    TRACE SQL statement debugging information. The number of logs at this level is related to SQL statement complexity and is irrelevant to the amount of data accessed.
    DEBUG Debugging information. Logs at this level record details about the operation status of the system during debugging, including the names, parameters, variables, and return values of the functions that are called.

    Notice

    The methods for viewing and setting the log level apply only to the election.log, observer.log, and rootservice.log files. Logs at or above the WARN level are recorded only in log files with the .wf extension.

    You can execute the SHOW PARAMETERS statement to query the current log level. By default, WDIAG logs are recorded.

    obclient> SHOW PARAMETERS LIKE '%syslog_level%';
    

    The return result is as follows:

    +-------+----------+----------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
    | zone  | svr_type | svr_ip         | svr_port | name         | data_type | value | info                                                                                                                         | section  | scope   | source  | edit_level        | default_value | isdefault |
    +-------+----------+----------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
    | zone1 | observer | 172.xx.xxx.xxx |     2882 | syslog_level | NULL      | WDIAG | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | WDIAG         |         1 |
    +-------+----------+----------------+----------+--------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
    1 row in set
    

    OceanBase Database allows you to set the log level to obtain more accurate logs. You can set the priority of logs to statement, session, and system levels, from high to low. OceanBase Database also allows you to specify the log level by module.

    • The log generation level set for the entire system takes effect for all OBServer nodes in the current cluster. You can set this level only in the sys tenant.
    • The log generation level set for the current session takes effect for the OBServer node where the current tenant is located.
      • A session-level variable takes effect only on the current session.
      • A global variable does not take effect on the current session and takes effect only on sessions established upon re-login.
    • The log generation level set for the current statement takes effect for the OBServer node where the current statement is executed. The level takes effect only during statement execution.

    The following section describes detailed information about the preceding three modes.

    • Set the log generation level for the entire system.

      You can use one of the following methods:

      • Use the syslog_level system parameter. For example, you can set the log generation level of the SQL module to DEBUG and that of the COMMON module to ERROR.

          obclient > ALTER SYSTEM SET syslog_level='sql.*:debug, common.*:error';
        
      • Run the bash kill -41/42 $pid command in the operating system.

        In the command, kill -41 is used to lower the level of program logs. For example, the current level of program logs is INFO. The log level is lowered to TRACE after you run the kill -41 command. kill -42 is used to raise the level of program logs. For example, the current level of program logs is INFO. The log level is raised to WARN after you run the kill -42 command.

        We recommend that you use the syslog_level system parameter. This is because when OceanBase Database refreshes configurations, it loads the syslog_level value specified in the observer.config.bin file in the etc/ directory, and thus the kill command is invalid.

        Notice

        We recommend that you use the kill -41 or kill -42 command to adjust the log level only when you cannot log in to the OceanBase cluster from the SQL client.

    • Set the log generation level for the current session.

      You can use the ob_log_level system parameter to set the log generation level. For example, you can set the log generation level of the SQL module to DEBUG and that of the COMMON module to INFO.

      obclient > SET @@ob_log_level='sql.*:debug, common.*:info';
      
    • Set the log generation level for the current statement.

      You can use a hint to set the log generation level. For example, you can set the log generation level of the SQL module to DEBUG and that of the COMMON module to INFO. For more information about hints, see Optimizer hints.

      obclient > SELECT /*+log_level('sql.*:debug, common.*:info')*/ * FROM t;
      

      Note

      If you want to execute SQL statements containing hints in a MySQL client, you must log in to the client by using the -c option. Otherwise, the MySQL client will remove the hints from the SQL statements as comments, and the system cannot receive the hints.

    Previous topic

    Overview
    Last

    Next topic

    Log stability
    Next