[jira] [Commented] (LOG4J2-3382) ${ctx:mdcValue} no longer populating in Property tag
[ https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17550532#comment-17550532 ] Lukas Krupa commented on LOG4J2-3382: - Please disregard my previous comment. After my detailed investigation I found the problem and it was my configuration :(. I used only 1 variable for pattern whereas 2 variable was changing, thus no new file created. > ${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 > Components: Configuration >Affects Versions: 2.17.0 >Reporter: Paul Brown >Assignee: Carter Kozak >Priority: Major > > Values added to the Thread Context are no longer accessible from Property > tags. > {{}} > {{{} name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}\{_}_{_}transaction\_$${ctx:txLogRecordType}.log{}}} > {{ }} > {{}} > {{}} > {{ }} > {{ }} > {{ }} > {{ name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}} > {{ fileName="${filename.transaction_log}"}} > {{ > filePattern="${filenamePattern.transaction_log}">}} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{}} > > 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. > Have also tried myserver_transaction_%X\{txLogRecordType}.log, but gives > similar output file. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (LOG4J2-3382) ${ctx:mdcValue} no longer populating in Property tag
[ https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17550500#comment-17550500 ] Lukas Krupa commented on LOG4J2-3382: - [~meanwhileinhell] did you resolved this? I just run into similar problem and I tried multiple combinations. I don't know since when this is broken, but I can't get new file created Still running some tests to figure out when/why this happens. > ${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 > Components: Configuration >Affects Versions: 2.17.0 >Reporter: Paul Brown >Assignee: Carter Kozak >Priority: Major > > Values added to the Thread Context are no longer accessible from Property > tags. > {{}} > {{{} name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}\{_}_{_}transaction\_$${ctx:txLogRecordType}.log{}}} > {{ }} > {{}} > {{}} > {{ }} > {{ }} > {{ }} > {{ name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}} > {{ fileName="${filename.transaction_log}"}} > {{ > filePattern="${filenamePattern.transaction_log}">}} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{}} > > 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. > Have also tried myserver_transaction_%X\{txLogRecordType}.log, but gives > similar output file. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (LOG4J2-3382) ${ctx:mdcValue} no longer populating in Property tag
[ https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17485333#comment-17485333 ] Carter Kozak commented on LOG4J2-3382: -- This PR addresses the ability to use properties within a routingappender route: [https://github.com/apache/logging-log4j2/pull/732] However, it would still require the: {code:java} ${sys:access.log.location}/${web:contextPath}_transaction_$${ctx:txLogRecordType}.log{code} to be modified to avoid escaping the {{{}$$\{ctx:txLogRecordType{: {code:java} ${sys:access.log.location}/${web:contextPath}_transaction_${ctx:txLogRecordType}.log{code} > ${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 > Components: Configuration >Affects Versions: 2.17.0 >Reporter: Paul Brown >Assignee: Carter Kozak >Priority: Major > > Values added to the Thread Context are no longer accessible from Property > tags. > {{}} > {{{} name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}\{_}_{_}transaction\_$${ctx:txLogRecordType}.log{}}} > {{ }} > {{}} > {{}} > {{ }} > {{ }} > {{ }} > {{ name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}} > {{ fileName="${filename.transaction_log}"}} > {{ > filePattern="${filenamePattern.transaction_log}">}} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{}} > > 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. > Have also tried myserver_transaction_%X\{txLogRecordType}.log, but gives > similar output file. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3382) ${ctx:mdcValue} no longer populating in Property tag
[ https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17484851#comment-17484851 ] Carter Kozak commented on LOG4J2-3382: -- Try replacing $${ctx:txLogRecordType} with ${ctx:txLogRecordType} > ${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 > Components: Configuration >Affects Versions: 2.17.0 >Reporter: Paul Brown >Assignee: Carter Kozak >Priority: Major > > Values added to the Thread Context are no longer accessible from Property > tags. > {{}} > {{{} name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}\{_}_{_}transaction\_$${ctx:txLogRecordType}.log{}}} > {{ }} > {{}} > {{}} > {{ }} > {{ }} > {{ }} > {{ name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}} > {{ fileName="${filename.transaction_log}"}} > {{ > filePattern="${filenamePattern.transaction_log}">}} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{}} > > 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. > Have also tried myserver_transaction_%X\{txLogRecordType}.log, but gives > similar output file. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3382) ${ctx:mdcValue} no longer populating in Property tag
[ https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17484848#comment-17484848 ] Paul Brown commented on LOG4J2-3382: I have tried the following config (with v2.17.1) but am still not getting the variable populated 'myserver_${ctx:txLogRecordType}_audit.log'. Is this what you meant? > ${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 > Components: Configuration >Affects Versions: 2.17.0 >Reporter: Paul Brown >Assignee: Carter Kozak >Priority: Major > > Values added to the Thread Context are no longer accessible from Property > tags. > {{}} > {{{} name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}\{_}_{_}transaction\_$${ctx:txLogRecordType}.log{}}} > {{ }} > {{}} > {{}} > {{ }} > {{ }} > {{ }} > {{ name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}} > {{ fileName="${filename.transaction_log}"}} > {{ > filePattern="${filenamePattern.transaction_log}">}} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{}} > > 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. > Have also tried myserver_transaction_%X\{txLogRecordType}.log, but gives > similar output file. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3382) ${ctx:mdcValue} no longer populating in Property tag
[ https://issues.apache.org/jira/browse/LOG4J2-3382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17484751#comment-17484751 ] Ralph Goers commented on LOG4J2-3382: - We are aware of this issue. The workaround for now is to move the ThreadContext variable reference to the filePattern. > ${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 > Components: Configuration >Affects Versions: 2.17.0 >Reporter: Paul Brown >Assignee: Carter Kozak >Priority: Major > > Values added to the Thread Context are no longer accessible from Property > tags. > {{}} > {{{} name="{}}}{{{}filename.transaction_log{}}}{{{}">${sys:access.log.location}/${web:contextPath}\{_}_{_}transaction\_$${ctx:txLogRecordType}.log{}}} > {{ }} > {{}} > {{}} > {{ }} > {{ }} > {{ }} > {{ name="Rolling-Transaction-Log-${ctx:txLogRecordType}"}} > {{ fileName="${filename.transaction_log}"}} > {{ > filePattern="${filenamePattern.transaction_log}">}} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{ }} > {{}} > > 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. > Have also tried myserver_transaction_%X\{txLogRecordType}.log, but gives > similar output file. -- This message was sent by Atlassian Jira (v8.20.1#820001)