Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Adjust the KafkaAppender #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Adjust the KafkaAppender #91

wants to merge 2 commits into from

Conversation

koekj
Copy link

@koekj koekj commented Dec 16, 2019

The appender is not starting when the org.kafka is set to DEBUG. It results that the solutions can't start kafka. By checking if the producer is activated the message can be appended. In other cases the messages are dropped.

The appender is not starting when the org.kafka is set to DEBUG. It results that the solutions can't start kafka. By checking if the procedure is activated the message can be appended. In other cases the messages are dropped.
@dsulimchuk
Copy link

Will this pull request be accepted?

@@ -46,7 +46,10 @@ public KafkaAppender() {
public void doAppend(E e) {
ensureDeferredAppends();
if (e instanceof ILoggingEvent && ((ILoggingEvent)e).getLoggerName().startsWith(KAFKA_LOGGER_PREFIX)) {
deferAppend(e);
//only in case the producer is initialized we are able to send messages.
if ( (lazyProducer != null ) && lazyProducer.isInitialized() ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this condition should rather guard the ensureDeferredAppends();in line 47, not? Buffering up messages in deferAppend while the producer is not initialized is somewhat intentional

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants