kezhenxu94 commented on code in PR #10516:
URL: https://github.com/apache/dolphinscheduler/pull/10516#discussion_r902211843
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java:
##########
@@ -620,28 +623,33 @@ private Constants() {
*/
public static final String LOGIN_USER_KEY_TAB_PATH =
"login.user.keytab.path";
+ public static final String WORKFLOW_INFO_MDC_KEY = "workflowInfo";
+ public static final String WORKFLOW_LOG_PREFIX_FORMAT =
"[WorkflowInstance-%s]";
Review Comment:
> Good idea, I add `workflowInstanceId` and `taskInstanceId` in MDC. Then
user can set the pattern by themselves. But some thread may does have these two
value in MDC, so the log may look a little strange.
>
> ```java
> [INFO] 2022-06-21 13:02:08.752 +0800
org.apache.dolphinscheduler.server.master.service.FailoverService:[91] -
[WorkflowInstance-0][TaskInstance-0] - Master failover service 192.168.1.3:5678
begin to failover hosts:[192.168.1.3:5678]
> [INFO] 2022-06-21 13:02:08.873 +0800
org.apache.dolphinscheduler.server.master.service.FailoverService:[143] -
[WorkflowInstance-0][TaskInstance-0] - start master[192.168.1.3:5678] failover,
need to failover process list size:1
> [INFO] 2022-06-21 13:02:08.880 +0800
org.apache.dolphinscheduler.server.master.service.FailoverService:[156] -
[WorkflowInstance-0][TaskInstance-0] - failover task instance id: 2151, process
instance id: 2008
> [INFO] 2022-06-21 13:02:08.880 +0800
org.apache.dolphinscheduler.server.master.service.FailoverService:[173] -
[WorkflowInstance-0][TaskInstance-0] - master[192.168.1.3:5678] failover end,
useTime:13ms
> ```
That's not a bit deal in my opinion, when setting log patterns, there are
some fields without values but we still want the placeholder there so when
users want to parse the logs they can have a uniform pattern (and filter some
logs for example by `> 0`) instead of configuring many patterns for different
logs
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]