[ 
https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul Brown updated LOG4J2-3382:
-------------------------------
    Description: 
Values added to the Thread Context are no longer accessible from Property tags.

{{<Properties>}}
{{{}    <Property 
name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}_transaction_$${ctx:txLogRecordType}.log{}}}
{{    </Property>}}
{{<Properties>}}
{{<appenders>}}
{{    }}{{<Routing name="TRANSACTION_LOG">}}
{{        }}{{<Routes pattern="$${ctx:txLogRecordType}">}}
{{            <Route>}}
{{                }}{{<RollingFile 
name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}}
{{                             }}{{fileName="${filename.transaction_log}"}}
{{                             
filePattern="${filenamePattern.transaction_log}">}}
{{                    <PatternLayout pattern="%m" />}}
{{                    <TimeBasedTriggeringPolicy interval="1" />}}
{{                    <DefaultRolloverStrategy max="31" />}}
{{                </RollingFile>}}
{{            </Route>}}
{{        </Routes>}}
{{    </Routing>}}
{{</appenders>}}

 

Added to the MDC in Java:

{{org.slf4j.MDC.put("txLogRecordType", eventType);}}

The file produced now looks like:

{{myservice_transaction_${ctx.txLogRecordType}_2022-01-27-16.log}}

Prior to upgrading to log4j2 2.17.0, this interpolated as expected.

> ${ctx:mdcValue} no longer populating in Property tag
> ----------------------------------------------------
>
>                 Key: LOG4J2-3382
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3382
>             Project: Log4j 2
>          Issue Type: Bug
>            Reporter: Paul Brown
>            Priority: Major
>
> Values added to the Thread Context are no longer accessible from Property 
> tags.
> {{<Properties>}}
> {{{}    <Property 
> name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}_transaction_$${ctx:txLogRecordType}.log{}}}
> {{    </Property>}}
> {{<Properties>}}
> {{<appenders>}}
> {{    }}{{<Routing name="TRANSACTION_LOG">}}
> {{        }}{{<Routes pattern="$${ctx:txLogRecordType}">}}
> {{            <Route>}}
> {{                }}{{<RollingFile 
> name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}}
> {{                             }}{{fileName="${filename.transaction_log}"}}
> {{                             
> filePattern="${filenamePattern.transaction_log}">}}
> {{                    <PatternLayout pattern="%m" />}}
> {{                    <TimeBasedTriggeringPolicy interval="1" />}}
> {{                    <DefaultRolloverStrategy max="31" />}}
> {{                </RollingFile>}}
> {{            </Route>}}
> {{        </Routes>}}
> {{    </Routing>}}
> {{</appenders>}}
>  
> Added to the MDC in Java:
> {{org.slf4j.MDC.put("txLogRecordType", eventType);}}
> The file produced now looks like:
> {{myservice_transaction_${ctx.txLogRecordType}_2022-01-27-16.log}}
> Prior to upgrading to log4j2 2.17.0, this interpolated as expected.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to