File tree Expand file tree Collapse file tree
java/io/temporal/samples/hello Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import io .temporal .workflow .WorkflowInterface ;
3232import io .temporal .workflow .WorkflowMethod ;
3333import java .time .Duration ;
34+ import org .slf4j .Logger ;
35+ import org .slf4j .LoggerFactory ;
3436
3537/** Sample Temporal Workflow Definition that executes a single Activity. */
3638public class HelloActivity {
@@ -107,8 +109,11 @@ public String getGreeting(String name) {
107109
108110 /** Simple activity implementation, that concatenates two strings. */
109111 static class GreetingActivitiesImpl implements GreetingActivities {
112+ private static final Logger log = LoggerFactory .getLogger (GreetingActivitiesImpl .class );
113+
110114 @ Override
111115 public String composeGreeting (String greeting , String name ) {
116+ log .info ("Composing greeting..." );
112117 return greeting + " " + name + "!" ;
113118 }
114119 }
Original file line number Diff line number Diff line change 2222 <!-- encoders are assigned the type
2323 ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
2424 <encoder >
25- <pattern >%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern >
25+ <!-- WorkflowId and ActivityId are keys populated by JavaSDK into MDC context -->
26+ <!-- See io.temporal.internal.logging.LoggerTag for a full list of keys -->
27+ <pattern >%d{HH:mm:ss.SSS} {%X{WorkflowId} %X{ActivityId}} [%thread] %-5level %logger{36} - %msg %n</pattern >
2628 </encoder >
2729 </appender >
2830 <logger name =" io.grpc.netty" level =" INFO" />
You can’t perform that action at this time.
0 commit comments