You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Carter Kozak (Jira)" <ji...@apache.org> on 2021/12/09 19:41:00 UTC
[jira] [Resolved] (LOG4J2-3202) Only allow lookups in message, not in parameters.
[ https://issues.apache.org/jira/browse/LOG4J2-3202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carter Kozak resolved LOG4J2-3202.
----------------------------------
Fix Version/s: 2.15.0
Resolution: Duplicate
This is resolved in the pending 2.15.0 release. Note that we aren't supporting lookups in the message or parameters, as it's less obvious than doing the lookup in code.
> Only allow lookups in message, not in parameters.
> -------------------------------------------------
>
> Key: LOG4J2-3202
> URL: https://issues.apache.org/jira/browse/LOG4J2-3202
> Project: Log4j 2
> Issue Type: Improvement
> Reporter: InkerBot
> Priority: Minor
> Fix For: 2.15.0
>
>
> For example, If someone named "${java:os}", he registered an account, I want to log it.
>
> {code:java}
> import org.apache.logging.log4j.LogManager
> fun main() {
> val logger = LogManager.getLogger("ww")
> val username = "\${java:os}"
> logger.error("username: {}",username)
> } {code}
>
> I want "username: ${java:os}", but got "username: Mac OS X 10.16, architecture: x86_64-64"
> If it is possible, could I have a flag to only lookup in message?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)