This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f2b86d1f7fa [log](FE) Add switch to control whether print log before 
execution (#36075)
f2b86d1f7fa is described below

commit f2b86d1f7fa2329803d9f56d57789500970d9ff5
Author: Gavin Chou <[email protected]>
AuthorDate: Fri Jun 14 21:59:54 2024 +0800

    [log](FE) Add switch to control whether print log before execution (#36075)
    
    The audit log prints the query when the query finished, however, we
    cannot known when the query starts exactly.
    To solve this problem, add a config option
    enable_print_request_before_execution, default false. It may be set to
    true by default in the future.
---
 fe/fe-common/src/main/java/org/apache/doris/common/Config.java | 5 +++++
 fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java 
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index 8ba16da2749..6fee1244ace 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -2652,6 +2652,11 @@ public class Config extends ConfigBase {
             "The threshold to do manual GC when doing checkpoint but not 
enough memory"})
     public static int checkpoint_manual_gc_threshold = 0;
 
+    @ConfField(mutable = true, description = {
+            "是否在每个请求开始之前打印一遍请求内容, 主要是query语句",
+            "Should the request content be logged before each request starts, 
specifically the query statements"})
+    public static boolean enable_print_request_before_execution = false;
+
     
//==========================================================================
     //                    begin of cloud config
     
//==========================================================================
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index b51148194eb..5d8958a53d7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -529,6 +529,9 @@ public class StmtExecutor {
         UUID uuid = UUID.randomUUID();
         TUniqueId queryId = new TUniqueId(uuid.getMostSignificantBits(), 
uuid.getLeastSignificantBits());
         TUniqueId firstQueryId = queryId;
+        if (Config.enable_print_request_before_execution) {
+            LOG.info("begin to execute query {} {}", queryId, originStmt == 
null ? "null" : originStmt.originStmt);
+        }
         int retryTime = Config.max_query_retry_time;
         retryTime = retryTime <= 0 ? 1 : retryTime + 1;
         for (int i = 1; i <= retryTime; i++) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to