Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing parameter instead of hard coded value for url #98

Closed
amiraziz opened this issue Dec 6, 2022 · 1 comment
Closed

passing parameter instead of hard coded value for url #98

amiraziz opened this issue Dec 6, 2022 · 1 comment

Comments

@amiraziz
Copy link

amiraziz commented Dec 6, 2022

Hi tkowalcz,

I saw in your sample that you used for example ${sys:loki.url} instead of real value in loki appendar in log4j example. log4j2-appender/README.md

i need to use something like this with passing config from spring boot yaml file. but i don't know how can pass parameter to log4j2 context to detect real value same your usage. although i don't know how you fill ${sys:loki.host} value in your example.

Thank you for helping me.

@tkowalcz
Copy link
Owner

Hi,

this is part of the documentation of log4j that describes how properties are interpolated. In a nutshell, the prefix sys, map, ctx etc. tells the logging system where to look for the property. In case of sys it will look at "system properties", if you use "env" then it will look at environment variables.

I never used Spring Boot with Loki but according to this documentation there is special integration and you can use spring to lookup values via spring boot.

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

No branches or pull requests

2 participants