Workaround for SLF4J version

When logging via the ReplayAwareLogger (Workflow.getLogger), key value pairs added via the fluent API in SLF4J get put in the message field, rather than their own field. Eg:

Workflow.getLogger(AWorkflowImpl.class).atInfo().addKeyValue("test", "testval").setMessage("Workflow started").log();

Currently outputs:

{"@timestamp":"2026-02-05T14:45:56.870017+11:00","@version":"1","message":"test=testval Workflow started"}

Should be outputting:

{"@timestamp":"2026-02-05T14:45:56.870017+11:00","@version":"1","message":"Workflow started","test":"testval"}

I don’t know if there are any short term plans to upgrade the Java SDK to use SLF4J 2.0, but I don’t appear to be able to create an issue on Github to raise the question.

Anyone worked around this limitation?
Thanks

I think you are correct in that ReplayAwareLogger does not currently propagate fluent api key/value pairs.

You can however do this now by using structured arguments unformatted, for example

import static net.logstash.logback.argument.StructuredArguments.kv;
// …

Workflow.getLogger(AWorkflowImpl.class)
.info(“Workflow started”, kv(“test”, “testval”));

will look at updating sdk and link issue and pr when ready

1 Like

Thank you! I can work with this while the SDK is being worked on. Cheers!