Custom Level and Properties does not work together #2279
Replies: 11 comments 1 reply
-
Version: 2.21.1
|
Beta Was this translation helpful? Give feedback.
-
I can´t see, but in my case, the problem is when i use a customlevels. If I remove the tag CustomLevels, all works fine. |
Beta Was this translation helpful? Give feedback.
-
Can you add your full configuration as text? Since all other nodes are interpolated using the properties that you provide, the |
Beta Was this translation helpful? Give feedback.
-
Yes, follow:
|
Beta Was this translation helpful? Give feedback.
-
Switch the order of <Configuration>
<Properties>
<Property name="basePath">${sys:catalina.home}/logs</Property>
</Properties>
<CustomLevels>
<CustomLevel name="EVENT" intLevel="550" />
</CustomLevels>
...
</Configuration> |
Beta Was this translation helpful? Give feedback.
-
Thanks, it worked partially. Now, it´s working when I use absolute path like a value. But, if I use a system parameter, por example, it doesn´t work. |
Beta Was this translation helpful? Give feedback.
-
Use: <Property name="basePath" value="${sys:catalina.home}/logs"/>
|
Beta Was this translation helpful? Give feedback.
-
So, it worked fully. But, I consider the first report a bug too. |
Beta Was this translation helpful? Give feedback.
-
When you add other elements before |
Beta Was this translation helpful? Give feedback.
-
I can´t see this message in stdout, but what I can see is the System property catalina.home is initilize before the container and so, it is store the log files in another folder of eclipse workspace. But this there isn´t a problem. |
Beta Was this translation helpful? Give feedback.
-
Regarding the second problem you reported, I am not able to reproduce it. Both: <Property name="basePath" value="${sys:catalina.home}/logs"/> and <Property name="basePath">${sys:catalina.home}/logs</Property> work for me. |
Beta Was this translation helpful? Give feedback.
-
Description
I´m implementing a log file contains trace of request for a funcionality. When i use absolute path in filename attribute of RoliingFileappender, it works fine. When I use property to declare filename, this is ignored and his key is used.
Configuration
Version: [Log4j 2.22.1]
Operating system: [Windows 10/Amazon Linux 2]
JDK: [Oracle 17]
Logs
Reproduction
[An isolated test reproducing the test.
JUnit tests similar to the ones in the code base are extremely appreciated.]
Beta Was this translation helpful? Give feedback.
All reactions