YArane opened a new issue #7814: URL: https://github.com/apache/pulsar/issues/7814
**Describe the bug** When using the context's logger, log messages are not produced on the function's log topic. Relevant docs: https://pulsar.apache.org/docs/en/functions-debug/#use-log-topic **To Reproduce** Steps to reproduce the behavior: 1. Create a Pulsar Function which logs a message using the context's logger (see `LoggingFunction.java` example below) 2. Deploy said function using `pulsar-admin` specifying a log-topic in the create command 3. Trigger the function / produce a message on one of its input topics 4. Log messages appear in the function's log file only **Expected behavior** Expected to see the log message produced on the function's log topic in addition to being printed to the log file. **Screenshots** ```java import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LoggingFunction implements Function<String, Void> { @Override public void apply(String input, Context context) { Logger LOG = context.getLogger(); Logger LOG2 = LoggerFactory.getLogger(this.getClass); LOG.info("This message appears in log file only") LOG2.info("This message appears in log file AND log topic") } } ``` ```bash $ bin/pulsar-admin functions create \ --log-topic persistent://public/default/logging-function-logs \ # Other function configs ``` **Desktop (please complete the following information):** - OS: iOS **Additional context** Pulsar 2.6.0 running in standalone mode (not in a docker container) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
