org.apache.logging.log4j.layout.template.json.resolver

Class ThreadContextStackResolver

  • java.lang.Object
    • org.apache.logging.log4j.layout.template.json.resolver.ThreadContextStackResolver
  • All Implemented Interfaces:
    EventResolver, TemplateResolver<LogEvent>


    public final class ThreadContextStackResolver
    extends Object
    implements EventResolver
    Nested Diagnostic Context (NDC), aka. Thread Context Stack, resolver.

    Configuration

     config  = [ pattern ]
     pattern = "pattern" -> string
     

    Examples

    Resolve all NDC values into a list:
     {
       "$resolver": "ndc"
     }
     
    Resolve all NDC values matching with the pattern regex:
     {
       "$resolver": "ndc",
       "pattern": "user(Role|Rank):\\w+"
     }
     

Copyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.