Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
spring boot log4j2.
deployed on wildfly server.
-
Important
Description
Hello Sir,
With log4j2 2.13.3 , Route appenders with context pattern checks for dynamic file writing are working fine. After 2.17.1 the functionality is broken.
I have upgraded to 2.17.1 and our java code, I am setting the ROUTINGKEY in threadcontext map. Also i set the system properties, log4j2.enableJndiLookup, log4j2.enableJndiJms, and log4j2.enableJndiContextSelector to true for all said tags after 2.17.1 upgrade.
When I check output file, its not writing the logs to Route File what we specify but general RollingFile logger appenders are working fine. Please let me know if you have faced this issue or any mitigation plan? Please let me know if you want any logs and i will share those if there is any specific procedure given.
Calling the below Route from Async logging.
here my example xml used the same as given in log4j2 documentaion.
<Route key="$${ctx:ROUTINGKEY}">
<RollingFile name="Rolling-default" fileName="logs/default.log"
filePattern="./logs/${date:yyyy-MM}/default-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout>
<pattern>%d{ISO8601} [%t] %p %c{3} - %m%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="6" modulate="true" />
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
</RollingFile>
</Route>
<Route>
<RollingFile name="Rolling-${ctx:ROUTINGKEY}" fileName="logs/other-${ctx:ROUTINGKEY}.log"
filePattern="./logs/${date:yyyy-MM}/${ctx:ROUTINGKEY}other%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout>
<pattern>%d{ISO8601} [%t] %p %c{3} - %m%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="6" modulate="true" />
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
</RollingFile>
</Route>
</Routes>
</Routing>
Attachments
Issue Links
- causes
-
LOG4J2-3424 JDBC Appender configuration properties not handled correctly after upgrading to 2.17.2
- Closed
- fixes
-
LOG4J2-3259 Limit string interpolation recursion level.
- Resolved
- is duplicated by
-
LOG4J2-3258 RollingFile fileName containing variables does not work on 2.17.0
- Resolved
-
LOG4J2-3346 After 2.17.0 upgarde Route appenders with dynamic file writing are not working
- Closed
-
LOG4J2-3382 ${ctx:mdcValue} no longer populating in Property tag
- Closed
-
LOG4J2-3350 Routing appender does not expand nested variables
- Closed
- relates to
-
LOG4J2-3592 Log4j 2.17.2 version not able to resolve system variable in log4j2.xml file
- Open