You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Gryslley
changed the title
How to load port out of application.properties
How to set port on application startup correctly
Sep 13, 2022
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
The text was updated successfully, but these errors were encountered: