thomas-gantenbein-tga commented on PR #16386:
URL: https://github.com/apache/camel/pull/16386#issuecomment-2509168815

   Just in case you decide not to remove MDC logging altogether: I think this 
could work now, @squakez. At least for logs from the log EIP or log component. 
For logs from Java code ... hm, well, that would still be shaky.
   
   I tried with the same route as above, that is:
   ```java
           from("netty-http:http://0.0.0.0:12345";)
               .routeId("netty")
               .log("in netty route")
               .to("direct:aSlowerRoute")
               .to("direct:aFasterRoute");
   
           from("timer:mytimer?period=5000&repeatCount=2&synchronous=true")
               .routeId("timer")
               .log("in timer route")
               .to("direct:aSlowerRoute")
               .to("direct:aFasterRoute");
   
           from("direct:aSlowerRoute")
               .log("in aSlowerRoute")
               .delay(simple("${random(50, 350)}"))
               .log("still in aSlowerRoute");
   
           from("direct:aFasterRoute")
               .log("in aFasterRoute")
               .delay(simple("${random(10, 70)}"))
               .log("still in aFasterRoute");
   
   ```
   Waited for the timer to fire two times, then `curl localhost:12345 && curl 
-H "traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4739-00f067aa0ba902b7-01" 
localhost:12345 && curl -H "traceparent: 
00-4bf92f3577b34da6a3ce929d0e0e4740-00f067aa0ba902b7-01" localhost:12345 && 
curl localhost:12345`
   
   Logs:
   ```
   20:12:44.994 INFO  Camel (camel-1) thread #2 - timer://mytimer 
[d7d91e81efc3acf4e0730bee88601e7c,6e1c0a64a2feec44] timer - in timer route
   20:12:45.015 INFO  Camel (camel-1) thread #2 - timer://mytimer 
[d7d91e81efc3acf4e0730bee88601e7c,1be08f81939abccc] route1 - in aSlowerRoute
   20:12:45.335 INFO  Camel (camel-1) thread #3 - Delay 
[d7d91e81efc3acf4e0730bee88601e7c,1be08f81939abccc] route1 - still in 
aSlowerRoute
   20:12:45.339 INFO  Camel (camel-1) thread #3 - Delay 
[d7d91e81efc3acf4e0730bee88601e7c,46d1457be03f7ada] route2 - in aFasterRoute
   20:12:45.397 INFO  Camel (camel-1) thread #4 - Delay 
[d7d91e81efc3acf4e0730bee88601e7c,46d1457be03f7ada] route2 - still in 
aFasterRoute
   
   20:12:49.868 INFO  Camel (camel-1) thread #2 - timer://mytimer 
[ef249c428653959d02560131d975b206,9141be8a7b20d5a5] timer - in timer route
   20:12:49.869 INFO  Camel (camel-1) thread #2 - timer://mytimer 
[ef249c428653959d02560131d975b206,0fae7d3d4de2631c] route1 - in aSlowerRoute
   20:12:49.983 INFO  Camel (camel-1) thread #3 - Delay 
[ef249c428653959d02560131d975b206,0fae7d3d4de2631c] route1 - still in 
aSlowerRoute
   20:12:49.984 INFO  Camel (camel-1) thread #3 - Delay 
[ef249c428653959d02560131d975b206,72e273fc1ff50c5a] route2 - in aFasterRoute
   20:12:50.028 INFO  Camel (camel-1) thread #4 - Delay 
[ef249c428653959d02560131d975b206,72e273fc1ff50c5a] route2 - still in 
aFasterRoute
   
   20:13:17.016 INFO  Camel (camel-1) thread #8 - NettyConsumerExecutorGroup 
[86aeeb0e2cb978b7b376430045338db5,283b751c9e8bd65e] netty - in netty route
   20:13:17.017 INFO  Camel (camel-1) thread #8 - NettyConsumerExecutorGroup 
[86aeeb0e2cb978b7b376430045338db5,2747fb1cca26d6dd] route1 - in aSlowerRoute
   20:13:17.079 INFO  Camel (camel-1) thread #5 - Delay 
[86aeeb0e2cb978b7b376430045338db5,2747fb1cca26d6dd] route1 - still in 
aSlowerRoute
   20:13:17.081 INFO  Camel (camel-1) thread #5 - Delay 
[86aeeb0e2cb978b7b376430045338db5,639427d08d593827] route2 - in aFasterRoute
   20:13:17.123 INFO  Camel (camel-1) thread #6 - Delay 
[86aeeb0e2cb978b7b376430045338db5,639427d08d593827] route2 - still in 
aFasterRoute
   
   20:13:17.173 INFO  Camel (camel-1) thread #12 - NettyConsumerExecutorGroup 
[4bf92f3577b34da6a3ce929d0e0e4739,df985068b674f995] netty - in netty route
   20:13:17.174 INFO  Camel (camel-1) thread #12 - NettyConsumerExecutorGroup 
[4bf92f3577b34da6a3ce929d0e0e4739,e06755720e1692de] route1 - in aSlowerRoute
   20:13:17.351 INFO  Camel (camel-1) thread #3 - Delay 
[4bf92f3577b34da6a3ce929d0e0e4739,e06755720e1692de] route1 - still in 
aSlowerRoute
   20:13:17.353 INFO  Camel (camel-1) thread #3 - Delay 
[4bf92f3577b34da6a3ce929d0e0e4739,08f9b17fe5fbee60] route2 - in aFasterRoute
   20:13:17.408 INFO  Camel (camel-1) thread #4 - Delay 
[4bf92f3577b34da6a3ce929d0e0e4739,08f9b17fe5fbee60] route2 - still in 
aFasterRoute
   
   20:13:17.429 INFO  Camel (camel-1) thread #16 - NettyConsumerExecutorGroup 
[4bf92f3577b34da6a3ce929d0e0e4740,5c9ba31a6a70e867] netty - in netty route
   20:13:17.430 INFO  Camel (camel-1) thread #16 - NettyConsumerExecutorGroup 
[4bf92f3577b34da6a3ce929d0e0e4740,7eed5ecec22b3281] route1 - in aSlowerRoute
   20:13:17.689 INFO  Camel (camel-1) thread #9 - Delay 
[4bf92f3577b34da6a3ce929d0e0e4740,7eed5ecec22b3281] route1 - still in 
aSlowerRoute
   20:13:17.690 INFO  Camel (camel-1) thread #9 - Delay 
[4bf92f3577b34da6a3ce929d0e0e4740,9920ef6a743629a7] route2 - in aFasterRoute
   20:13:17.720 INFO  Camel (camel-1) thread #10 - Delay 
[4bf92f3577b34da6a3ce929d0e0e4740,9920ef6a743629a7] route2 - still in 
aFasterRoute
   
   20:13:17.741 INFO  Camel (camel-1) thread #20 - NettyConsumerExecutorGroup 
[8f1095f44448c6632ba4e97597a2ce5a,66661fb8786cf397] netty - in netty route
   20:13:17.742 INFO  Camel (camel-1) thread #20 - NettyConsumerExecutorGroup 
[8f1095f44448c6632ba4e97597a2ce5a,3b42be0fae97dd0e] route1 - in aSlowerRoute
   20:13:17.799 INFO  Camel (camel-1) thread #5 - Delay 
[8f1095f44448c6632ba4e97597a2ce5a,3b42be0fae97dd0e] route1 - still in 
aSlowerRoute
   20:13:17.800 INFO  Camel (camel-1) thread #5 - Delay 
[8f1095f44448c6632ba4e97597a2ce5a,e5fc8dae051fc33e] route2 - in aFasterRoute
   20:13:17.839 INFO  Camel (camel-1) thread #6 - Delay 
[8f1095f44448c6632ba4e97597a2ce5a,e5fc8dae051fc33e] route2 - still in 
aFasterRoute
   ```


-- 
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...@camel.apache.org

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

Reply via email to