김태우
김태우

Reputation: 1255

using application.properties value in resources / logback-spring.xml

i want to Use spring boot's application.properties value in resources/logback-spring.xml.

But do not use it like this: application.properties

server.kafka.host0=kafka-0

logback-spring.xml

<producerConfig>bootstrap.servers=${server.kafka.host0}:9092</producerConfig>

How can I write? Help me.

Upvotes: 0

Views: 63

Answers (1)

Andreas
Andreas

Reputation: 2521

You can access it by using <springProperty> tag as stated in here

<springProperty scope="context" name="kafkaHost0" source="server.kafka.host0"/>
<producerConfig>bootstrap.servers=${kafkaHost0}:9092</producerConfig>

Upvotes: 1

Related Questions