Skip to main content

FE Log Management

This document is for operations and development engineers running a Doris cluster. It describes the logging system of the FE (Frontend) process, including log file categories, log retention and rolling policies, how to enable DEBUG logs at runtime, and how to integrate logs in container environments.

This document applies to Doris 2.1.4 and later versions.

Use Cases

ScenarioRecommended section
Understand which log files FE produces and what each one is forLog Categories
Adjust log retention days, single-file size, or rolling policyLog Configuration
Enable DEBUG logs for a specific class or package while troubleshootingEnable DEBUG Logs
Deploy in Kubernetes or another container environment and send logs to stdoutContainer Environment Log Configuration
Find where the audit log is and what it recordsfe.audit.log in Log Categories and the audit-related parameters in Log Configuration

Log Categories

After starting the FE process with sh bin/start_fe.sh --daemon, the FE log directory (controlled by the LOG_DIR configuration, default is the log/ directory under the FE deployment path) produces the following log files:

Log fileTypeDescription
fe.logRuntime log (main)The main log of the FE process. Contains runtime logs at all levels (DEBUG, INFO, WARN, ERROR, and so on).
fe.warn.logRuntime log (warnings)Records only logs at WARN level and above. A subset of fe.log, useful for quickly checking warnings or errors.
fe.audit.logAudit logRecords all database operations (SQL, DDL, DML, and so on) executed through this FE node.
fe.outStandard output / error streamCaptures echo output from the start script and log messages not captured by the log4j framework. A supplement to the runtime log. In rare cases, you may need to check it for additional information.
fe.gc.logJVM GC logGarbage collection log of the FE JVM. Its behavior is controlled by JAVA_OPTS in fe.conf.

Log Configuration

The following configuration items are all in the fe.conf file. They control log storage path, retention time, retention count, single-file size, and related behavior.

General Configuration

Configuration ItemDefault ValueOptionsDescription
LOG_DIRENV(DORIS_HOME)/logStorage path for all logs. Default is the log/ directory under the FE deployment path. Note that this is an environment variable and the configuration name must be in uppercase.
sys_log_levelINFOINFO, WARN, ERROR, FATALLog level of fe.log. Default is INFO. Changing this is not recommended, since the INFO level contains many critical log messages.
sys_log_modeNORMALNORMAL, BRIEF, ASYNCOutput mode of FE logs. NORMAL is the default mode: logs are written synchronously and include location information. ASYNC writes logs asynchronously and includes location information. BRIEF writes logs asynchronously but omits location information. Performance increases from NORMAL to ASYNC to BRIEF.
note

Starting from version 3.0.2, the default value of sys_log_mode is changed to ASYNC.

Runtime Logs (fe.log / fe.warn.log)

Configuration ItemDefault ValueOptionsDescription
log_roll_size_mb1024Maximum size of an individual fe.log, fe.warn.log, or fe.audit.log file. Default is 1024 MB. When a single log file exceeds this threshold, a new file is created automatically.
sys_log_roll_intervalDAYDAY, HOURRolling interval of fe.log and fe.warn.log. Default is 1 day, meaning a new log file is generated each day.
sys_log_roll_num10Maximum number of fe.log and fe.warn.log files within a single day. Default is 10. When the file count exceeds this threshold due to rolling or splitting, older log files are deleted.
sys_log_enable_compressfalsetrue, falseWhether to enable compression for historical fe.log and fe.warn.log files. Default is off. When enabled, historical logs are archived using gzip compression.
sys_log_verbose_modulesEnables DEBUG-level logging for the specified Java packages or classes. See Enable DEBUG Logs.
tip

sys_log_roll_num controls the number of retained logs per day, not the total count. It must be combined with sys_log_delete_age to determine the total number of retained logs.

Audit Log (fe.audit.log)

Configuration ItemDefault ValueOptionsDescription
audit_log_dirENV(DORIS_HOME)/logSeparate storage path for fe.audit.log. Default is the log/ directory under the FE deployment path.
audit_log_roll_intervalDAYDAY, HOURRolling interval of fe.audit.log. Default is 1 day, meaning a new log file is generated each day.
audit_log_roll_num90Maximum number of fe.audit.log files. Default is 90. When the file count exceeds this threshold due to rolling or splitting, older log files are deleted.
audit_log_enable_compressfalsetrue, falseWhether to enable compression for historical fe.audit.log files. Default is off. When enabled, historical audit logs are archived using gzip compression.
audit_log_modules{"slow_query", "query", "load", "stream_load"}Module types recorded in fe.audit.log. Defaults are slow query, query, load, and stream load. "Query" includes all DDL, DML, and SQL operations; "slow query" refers to such operations whose execution time exceeds the qe_slow_log_ms threshold; "load" refers to Broker Load; "stream load" refers to stream load operations.
qe_slow_log_ms5000When the execution time of a DDL, DML, or SQL statement exceeds this threshold, it is recorded separately in the slow_query module of fe.audit.log. Default is 5000 ms.
sql_digest_generation_threshold_ms5000Time threshold for sql_digest generation, in milliseconds. If a query's response time exceeds this threshold, a sql_digest is generated for it in fe.audit.log. Default is 5000 ms.

Retention by Time (log_rollover_strategy = age)

Configuration ItemDefault ValueOptionsDescription
log_rollover_strategyageage, sizeLog retention strategy. Default is age, which retains historical logs by time; size retains historical logs by total size.
sys_log_delete_age7dSupports formats like 7d, 10h, 60m, 120sEffective only when log_rollover_strategy is age. Controls the retention period for fe.log and fe.warn.log files. Default is 7 days. Logs older than 7 days are deleted automatically.
audit_log_delete_age30dSupports formats like 7d, 10h, 60m, 120sEffective only when log_rollover_strategy is age. Controls the retention period for fe.audit.log files. Default is 30 days. Logs older than 30 days are deleted automatically.

Retention by Size (log_rollover_strategy = size)

Configuration ItemDefault ValueOptionsDescription
info_sys_accumulated_file_size4Effective only when log_rollover_strategy is size. Controls the cumulative size of fe.log files. Default is 4 GB. When the cumulative log size exceeds this threshold, historical log files are deleted.
warn_sys_accumulated_file_size2Effective only when log_rollover_strategy is size. Controls the cumulative size of fe.warn.log files. Default is 2 GB. When the cumulative log size exceeds this threshold, historical log files are deleted.
audit_sys_accumulated_file_size4Effective only when log_rollover_strategy is size. Controls the cumulative size of fe.audit.log files. Default is 4 GB. When the cumulative log size exceeds this threshold, historical log files are deleted.

Enable DEBUG Logs

DEBUG-level logs on FE can be turned on by modifying the configuration file, or at runtime through the UI or a REST API. The three options compare as follows:

MethodRestart requiredScopeUse case
Modify fe.confFE restart requiredAll nodes apply their own configuration after restartKeep certain DEBUG logs on long term
FE UINo restartOnly the current FE nodeTemporary investigation, visual operation
REST APINo restartOnly the target FE nodeTemporary investigation, scripted bulk operations

Option 1: Through the Configuration File

Add sys_log_verbose_modules to fe.conf. For example:

# Enable DEBUG log only for the class org.apache.doris.catalog.Catalog
sys_log_verbose_modules=org.apache.doris.catalog.Catalog

# Enable DEBUG log for all classes under the package org.apache.doris.catalog
sys_log_verbose_modules=org.apache.doris.catalog

# Enable DEBUG log for all classes under the package org
sys_log_verbose_modules=org

Add the configuration item and restart the FE node for it to take effect.

Option 2: Through the FE UI

The UI supports changing log levels at runtime without restarting the FE node. Procedure:

  1. Open the FE node's HTTP port (default 8030) in a browser and sign in to the UI.

  2. Click the Log tab in the top navigation bar.

    Through the FE UI

  3. In the Add input box, enter a package name or specific class name to turn on the corresponding DEBUG log. For example, entering org.apache.doris.catalog.Catalog turns on DEBUG logging for the Catalog class:

    Through the FE UI

  4. In the Delete input box, enter a package name or specific class name to turn off the corresponding DEBUG log.

note

Changes made here only affect the log level of the corresponding FE node and do not affect other FE nodes.

Option 3: Through the REST API

The REST API also supports changing log levels at runtime without restarting the FE node.

  • Enable DEBUG log

    curl -X POST -uuser:passwd fe_host:http_port/rest/v1/log?add_verbose=org.apache.doris.catalog.Catalog

    The username and password belong to the root or admin user that signs in to Doris. The add_verbose parameter specifies the package or class name to enable DEBUG logging for. On success, the response is:

    {
    "msg": "success",
    "code": 0,
    "data": {
    "LogConfiguration": {
    "VerboseNames": "org,org.apache.doris.catalog.Catalog",
    "AuditNames": "slow_query,query,load",
    "Level": "INFO"
    }
    },
    "count": 0
    }
  • Disable DEBUG log

    curl -X POST -uuser:passwd fe_host:http_port/rest/v1/log?del_verbose=org.apache.doris.catalog.Catalog

    The del_verbose parameter specifies the package or class name to disable DEBUG logging for.

Container Environment Log Configuration

In some scenarios (for example, deploying the FE process through Kubernetes), all logs must go to the standard output stream instead of files, so that the container log collector can pick them up uniformly.

Startup Method

Start the FE process in the foreground with the following command. All logs are then sent to the standard output stream:

sh bin/start_fe.sh --console

Log Prefix Identification

To distinguish different log types in the same standard output stream, a different prefix is added to each log line. Example output:

RuntimeLogger 2024-06-24 00:05:21,522 INFO (main|1) [DorisFE.start():158] Doris FE starting...
RuntimeLogger 2024-06-24 00:05:21,530 INFO (main|1) [FrontendOptions.analyzePriorityCidrs():194] configured prior_cidrs value: 172.20.32.136/24
RuntimeLogger 2024-06-24 00:05:21,535 INFO (main|1) [FrontendOptions.initAddrUseIp():101] local address: /172.20.32.136.
RuntimeLogger 2024-06-24 00:05:21,740 INFO (main|1) [ConsistencyChecker.initWorkTime():106] consistency checker will work from 23:00 to 23:00
RuntimeLogger 2024-06-24 00:05:21,889 ERROR (main|1) [Util.report():128] SLF4J: Class path contains multiple SLF4J bindings.

Each prefix corresponds to the following log type:

PrefixCorresponding log fileDescription
StdoutLoggerfe.outLogs from the standard output stream.
StderrLoggerfe.outLogs from the standard error stream.
RuntimeLoggerfe.logMain FE runtime log.
AuditLoggerfe.audit.logAudit log.
No prefixfe.gc.logGC log.

Additional Configuration for Container Environments

Configuration ItemDefault ValueOptionsDescription
enable_file_loggertruetrue, falseWhether to enable file logging. Default is true. When the FE process is started with the --console command, logs are written to both the standard output stream and the regular log files. When set to false, logs are written only to the standard output stream and no log files are produced.