You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Matt Pavlovich (Jira)" <ji...@apache.org> on 2019/12/06 17:17:00 UTC

[jira] [Updated] (LOG4J2-2732) Add ThreadContext.putIfNull(String, String)

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

Matt Pavlovich updated LOG4J2-2732:
-----------------------------------
    Description: 
Provide a helper method that provides a 1-liner to put an identifier only if it is not set.

{noformat}
if(!ThreadContext.containsKey("uniqueId")) {
   ThreadContext.put("uniqueId", generateUniqueId());

  was:
Provide a helper method that provides a 1-liner to put an identifier only if it is not set.

{noformat}
if(!ThreadContext.containsKey("uniqueId")) {


> Add ThreadContext.putIfNull(String, String)
> -------------------------------------------
>
>                 Key: LOG4J2-2732
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2732
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: API
>            Reporter: Matt Pavlovich
>            Priority: Major
>
> Provide a helper method that provides a 1-liner to put an identifier only if it is not set.
> {noformat}
> if(!ThreadContext.containsKey("uniqueId")) {
>    ThreadContext.put("uniqueId", generateUniqueId());



--
This message was sent by Atlassian Jira
(v8.3.4#803005)