Class Routes
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.routing.Routes
-
@Plugin(name="Routes", category="Core", printObject=true) public final class Routes extends Object
Contains the individual Route elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Routes.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Routes
createRoutes(String pattern, Route... routes)
Deprecated.since 2.7; usenewBuilder()
.String
getPattern(LogEvent event, ConcurrentMap<Object,Object> scriptStaticVariables)
Returns the pattern.AbstractScript
getPatternScript()
Gets the optional script that decides which route to pick.Route
getRoute(String key)
Route[]
getRoutes()
Returns the array of Route elements.static Routes.Builder
newBuilder()
String
toString()
-
-
-
Method Detail
-
createRoutes
@Deprecated public static Routes createRoutes(String pattern, Route... routes)
Deprecated.since 2.7; usenewBuilder()
.Creates the Routes.- Parameters:
pattern
- The pattern.routes
- An array of Route elements.- Returns:
- The Routes container.
-
newBuilder
@PluginBuilderFactory public static Routes.Builder newBuilder()
-
getPattern
public String getPattern(LogEvent event, ConcurrentMap<Object,Object> scriptStaticVariables)
Returns the pattern.- Parameters:
event
- The log event passed to the script (if there is a script.)scriptStaticVariables
- The script's static variables.- Returns:
- the pattern.
-
getPatternScript
public AbstractScript getPatternScript()
Gets the optional script that decides which route to pick.- Returns:
- the optional script that decides which route to pick. May be null.
-
getRoutes
public Route[] getRoutes()
Returns the array of Route elements.- Returns:
- an array of Route elements.
-
-