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

How to set port on application startup correctly #41

Open
Gryslley opened this issue Sep 13, 2022 · 0 comments
Open

How to set port on application startup correctly #41

Gryslley opened this issue Sep 13, 2022 · 0 comments

Comments

@Gryslley
Copy link

Hey,

I want to use this log4j appender for Fluentd.
My problem is that I need to set the port variable depending on the user.
Therefore I use ThredContext.put("portProp", "12345") in my main.
Also, I use <Sevcer host="localhost" port="${ctx:portProp}" in the log4j2.xml, which should work.
At least it works for every pool thread, except for pool-2-thread-1, which gets the default number 0.
However, if I want to set some other variable in the xml file in the same way, it works perfectly fine.
Can you tell me what the problem is and how I can fix it?

Best regards,
David

@Gryslley Gryslley changed the title How to load port out of application.properties How to set port on application startup correctly Sep 13, 2022
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

1 participant