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 StringgetName()voidresolve(LogEvent logEvent, JsonWriter jsonWriter) Resolves the givenvalueusing the providedJsonWriter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:TemplateResolverResolves the givenvalueusing the providedJsonWriter.- Specified by:
resolvein interfaceTemplateResolver<LogEvent>
-