Class MainMapResolver
- java.lang.Object
-
- org.apache.logging.log4j.layout.template.json.resolver.MainMapResolver
-
- All Implemented Interfaces:
EventResolver
,TemplateResolver<LogEvent>
public final class MainMapResolver extends java.lang.Object implements EventResolver
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:
MainMapResolver
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
key
private static MainMapLookup
MAIN_MAP_LOOKUP
-
Constructor Summary
Constructors Constructor Description MainMapResolver(TemplateResolverConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.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 Detail
-
MAIN_MAP_LOOKUP
private static final MainMapLookup MAIN_MAP_LOOKUP
-
key
private final java.lang.String key
-
-
Constructor Detail
-
MainMapResolver
MainMapResolver(TemplateResolverConfig config)
-
-
Method Detail
-
getName
static java.lang.String getName()
-
resolve
public void resolve(LogEvent logEvent, JsonWriter jsonWriter)
Description copied from interface:TemplateResolver
Resolves the givenvalue
using the providedJsonWriter
.- Specified by:
resolve
in interfaceTemplateResolver<LogEvent>
-
-