Say I have log4j2-spring.xml file with all the configuration of the appenders. There is a way to inject to the xml value from application.properties file?
My spring-log4j2.xml look like that:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Syslog name="ElkLogs" host="${logstash.host}" port="5002" protocol="UDP">
</Syslogs>
<Async name="AsyncElkLogs">
<AppenderRef ref="ElkLogs"
</Async>
</Appenders>
<Loggers>
<Root>
<AppenderRef ref="AsyncElkLogs"/>
</Root>
</Loggers>
</Configuration>
my application-dev.properties file:
logstash.host=elk-dev-1
my application-prod.properties file:
logstash.host=elk-prod-1