Set the logging context on the PatternLayout

This commit is contained in:
Chris Eager authored and Chris Eager committed 2026-01-05 17:01:11 -06:00
1 parent e1c44dd374
commit 54443f7015
1 file changed
+1
@@ -101,6 +101,7 @@ public class LogstashTcpSocketAppenderFactory extends AbstractAppenderFactory<IL
final LayoutWrappingEncoder<ILoggingEvent> prefix = new LayoutWrappingEncoder<>();
final PatternLayout layout = new PatternLayout();
layout.setPattern(String.format("%s ", apiKey.value()));
layout.setContext(context);
prefix.setLayout(layout);
encoder.setPrefix(prefix);
appender.setEncoder(encoder);