ashmeet13 commented on code in PR #12684:
URL: https://github.com/apache/kafka/pull/12684#discussion_r1013311309


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -1450,4 +1453,15 @@ public static String[] enumOptions(Class<? extends 
Enum<?>> enumClass) {
                 .toArray(String[]::new);
     }
 
+    /**
+     * Convert time instant to readable string for logging
+     * @param timestamp the timestamp of the instant to be converted.
+     *
+     * @return string value of a given timestamp in the format "yyyy-MM-dd 
HH:mm:ss,SSS"
+     */
+    public static String toLogDateTimeFormat(long timestamp) {
+        final DateTimeFormatter dateTimeFormatter = 
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS");

Review Comment:
   Hi @cadonna, Thank you for the review!
   I have added the change for this. A few sample logs with the updated 
datetime format -
   
   ```
   [2022-11-04 00:36:28,517] INFO stream-thread 
[stream-thread-test-87bf53a8-54f2-485f-a4b6-acdbec0a8b3d-StreamThread-1] 
Triggering the followup rebalance scheduled for 2022-11-04 00:36:28,511 +05:30. 
(org.apache.kafka.streams.processor.internals.StreamThread:614)
   ```
   ```
   [2022-11-04 00:46:52,220] INFO stream-thread [] Requesting followup 
rebalance be scheduled by consumer10 for 2022-11-04 00:56:52,212 +05:30 to 
probe for caught-up replica tasks. 
(org.apache.kafka.streams.processor.internals.StreamsPartitionAssignor:960)
   ```



-- 
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]

Reply via email to