Class MainMapResolver
java.lang.Object
org.apache.logging.log4j.layout.template.json.resolver.MainMapResolver
- All Implemented Interfaces:
EventResolver
,TemplateResolver<LogEvent>
An index-based resolver for the main() method arguments.
Configuration
config = index | key index = "index" -> number key = "key" -> string
Examples
Resolve the 1st main() method argument:{ "$resolver": "main", "index": 0 }Resolve the argument coming right after --userId:
{ "$resolver": "main", "key": "--userId" }
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
getName()
void
resolve
(LogEvent logEvent, JsonWriter jsonWriter) Resolves the givenvalue
using the providedJsonWriter
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.layout.template.json.resolver.TemplateResolver
isFlattening, isResolvable, isResolvable, resolve
-
Field Details
-
MAIN_MAP_LOOKUP
-
key
-
-
Constructor Details
-
MainMapResolver
MainMapResolver(TemplateResolverConfig config)
-
-
Method Details
-
getName
-
resolve
Description copied from interface:TemplateResolver
Resolves the givenvalue
using the providedJsonWriter
.- Specified by:
resolve
in interfaceTemplateResolver<LogEvent>
-