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

AutoScan not working with Appender properties #37

Open
VidhyaKailash opened this issue Dec 9, 2016 · 2 comments
Open

AutoScan not working with Appender properties #37

VidhyaKailash opened this issue Dec 9, 2016 · 2 comments

Comments

@VidhyaKailash
Copy link

I am trying to use the TurboFiltercalled ReconfigureOnChangeFilter to change the properties of appender like broker and topic and they wouldnt take effect with the KafkaAppender.
http://logback.qos.ch/manual/configuration.html#autoScan

Can somebody please point me to how I can implement this quickly for the Kafka Appender. We have an environment where we might need to change the brokers or topicname maybe not so frequently, but preferably without restarting the server.

thanks
Vidhya

@danielwegener
Copy link
Owner

danielwegener commented Feb 23, 2017

I am not really sure how the ReconfigureOnChangeFilter works, i.e. if if really reinitializes the logging context using reset (in that case, the kafka appender should naturally work) or if it simply reapplies all properties to the existing appender.
It the latter case what could probably make it work would be to trigger a producer reinitialization on each producer configuration change (e.g. in com.github.danielwegener.logback.kafka.KafkaAppenderConfig#addProducerConfigValue). But since these changes are not all applied at once but one after another while joran fires its sax event listeners one would have to debounce the automatic appender reconfiguration. It would also be a clever idea to keep the old producer running until the new producer has collected meta data and is ready to deliver.

@danielwegener
Copy link
Owner

Just dived into the code. A simple reset is not enough since it just stops all appenders but does not restart them. To reload the kafka producer, the whole configuration has to be reinitialized (using the JoranConfigurer path).

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

No branches or pull requests

2 participants