During routine O&M, when an Elasticsearch cluster becomes sluggish, returns an error for a query request, or shows a yellow status, the O&M team must be able to obtain relevant information immediately. CSS provides a log query feature that aggregates underlying server logs to the console, where you can query them by node and log level in seconds. By analyzing run logs, slow query logs, and deprecation logs, you can quickly locate the root causes of faults and issues. Additionally, you can dynamically adjust log levels and enable trace logging for debugging, allowing you to obtain the most detailed log records without restarting your cluster.
Query recently generated logs that are not yet archived.
You can search records by log type, node, log level, or keyword. For a detailed description of each type of logs, see Log Types.
When a log file reaches 128 MB or when the time reaches 00:00 UTC, the system automatically compresses and archives it. Only unarchived logs appear on the log search page, while archived logs remain accessible through the log backup function. For more information, see Backing Up Logs to OBS.
Log4j2 is used as the log component in Elasticsearch clusters. Multiple log levels (ERROR, WARN, INFO, DEBUG, and TRACE) are supported. The default log level is INFO. To facilitate troubleshooting and debugging, you can dynamically adjust the log levels.
The left part of the console is the command input box, and the triangle icon in its upper-right corner is the execution button. The right part shows the execution result.
PUT _cluster/settings{"persistent": {"logger": {"org.elasticsearch.action": "DEBUG"}}}
PUT _cluster/settings{"persistent": {"logger": {"org.elasticsearch.action": null}}}
To analyze communication details on the HTTP or transport layer, you can enable trace logging for the HTTP or Transport module to obtain detailed log records.
The left part of the console is the command input box, and the triangle icon in its upper-right corner is the execution button. The right part shows the execution result.
PUT _cluster/settings{"transient": {"logger.org.elasticsearch.transport.TransportService.tracer": "trace","transport.tracer.include": "","http.tracer.include": "","logger.org.elasticsearch.http.HttpTracer": "trace"}}
Enabling trace logging is a non-persistent configuration and will be disabled upon a cluster restart. It is typically used for emergency packet capture and analysis during troubleshooting.
Log Type | Description | Purpose |
|---|---|---|
Run logs | Run logs, or main logs, record the cluster status and key information about write and query operations. For example, write logs record operations such as index creation, index mapping update, and write queue exhaustion; and query logs record query queue status and query exceptions. | Check the status and write and query operations of each cluster node, including inter-node connectivity, full GC, index creation or deletion, and cluster-level query errors. |
Slow indexing logs | Slow indexing logs record indexing operations (such as bulk, index, update, and delete) that took a long time to complete, helping you identify performance bottlenecks. | In the case of slow write performance, you can query slow indexing logs to locate the cause. |
Slow query logs | Slow query logs record search requests that took a long time to complete. They help you monitor and analyze time-consuming search requests, so you can identify performance bottlenecks, optimize SQL queries, and improve overall system performance. | In the case of slow query performance, you can query slow query logs to locate the cause. |
Deprecation logs | Deprecation logs record deprecation warnings. Deprecation warnings are written to this log when you use APIs, configurations, or functions that are marked for removal in future versions. | Check for APIs or features that are about to expire in future versions. |
Access logs | Access logs record cluster access requests, such as the request path and source address. You cannot check access logs on the console. To check them, you need to back them up to an OBS bucket or transfer them to a target cluster first. | If there is a surge in service requests, you can analyze the request sources and paths by checking the access logs. |
Run logs record the cluster status and key information about write and query operations. For example, the log record below indicates that an index named test was created and later the cluster status changed from YELLOW to GREEN.
Figure 1 A sample of run logs

Log content:
Slow indexing logs record indexing operations that took a long time to complete. For example, the log record below shows an indexing request that lasted longer than the preset threshold. The log contains the index name, duration, and request content.
Figure 2 A sample of slow indexing logs

Log content: 1. Log generation time
Slow query logs record search requests that took a long time to complete. For example, the log record below shows a search request that lasted longer than the preset threshold. The log contains the index name, duration, and request content.
Figure 3 A sample of slow query logs

Log content:
Deprecation logs record deprecation warnings. For example, the log record below indicates that GET /_cat/master has been deprecated and should be replaced with GET /_cat/cluster_manager.
Figure 4 A sample of deprecation logs

Log content:
Access logs record cluster access requests and source addresses. For example, the log record below has recorded source information for the /_snapshot/my_backup/my_snapshot/_restore?pretty=true operation.
Figure 5 A sample of access logs

Log content:
How Do I Set Slow Query Log Thresholds for an Elasticsearch Cluster of CSS?