gavinchou commented on code in PR #37894:
URL: https://github.com/apache/doris/pull/37894#discussion_r1678906155


##########
fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java:
##########
@@ -47,15 +57,52 @@ public class AuditLogHelper {
     public static void logAuditLog(ConnectContext ctx, String origStmt, 
StatementBase parsedStmt,
             org.apache.doris.proto.Data.PQueryStatistics statistics, boolean 
printFuzzyVariables) {
         try {
+            origStmt = handleStmt(origStmt, parsedStmt);
             logAuditLogImpl(ctx, origStmt, parsedStmt, statistics, 
printFuzzyVariables);
         } catch (Throwable t) {
             LOG.warn("Failed to write audit log.", t);
         }
     }
 
+    private static String handleStmt(String origStmt, StatementBase 
parsedStmt) {
+        int length = Math.min(GlobalVariable.auditPluginMaxSqlLength, 
origStmt.length());
+        origStmt = origStmt.replace("\n", " ").substring(0, length);

Review Comment:
   \r\n



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to