Closed mangatmodi closed 4 years ago
My bad. I didn't realize that we can always access environment variables in the configuration file. Here is an example working for me
<Slack name="Slack"
channel="channel-name"
webhookUrl="${env:SLACK_WEBHOOK:-default_url}"
>
<PatternLayout pattern="%-5p - [%t]"/>
</Slack>
Currently the library take webhook url from the
log4j2.xml
configuration. However webhook url is a secret, hence I could not expose it in the source code. Is there a way I can inject the url from the environment?If not, then I would be happy to create the PR for it.