"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

RoutingAppender.java  (apache-log4j-2.11.1-src):RoutingAppender.java  (apache-log4j-2.11.2-src)
skipping to change at line 38 skipping to change at line 38
import org.apache.logging.log4j.core.Appender; import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Core; import org.apache.logging.log4j.core.Core;
import org.apache.logging.log4j.core.Filter; import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.LifeCycle2; import org.apache.logging.log4j.core.LifeCycle2;
import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender; import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.appender.rewrite.RewritePolicy; import org.apache.logging.log4j.core.appender.rewrite.RewritePolicy;
import org.apache.logging.log4j.core.config.AppenderControl; import org.apache.logging.log4j.core.config.AppenderControl;
import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.Node; import org.apache.logging.log4j.core.config.Node;
import org.apache.logging.log4j.core.config.Property;
import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory; import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
import org.apache.logging.log4j.core.config.plugins.PluginElement; import org.apache.logging.log4j.core.config.plugins.PluginElement;
import org.apache.logging.log4j.core.script.AbstractScript; import org.apache.logging.log4j.core.script.AbstractScript;
import org.apache.logging.log4j.core.script.ScriptManager; import org.apache.logging.log4j.core.script.ScriptManager;
import org.apache.logging.log4j.core.util.Booleans; import org.apache.logging.log4j.core.util.Booleans;
/** /**
* This Appender "routes" between various Appenders, some of which can be refere nces to * This Appender "routes" between various Appenders, some of which can be refere nces to
* Appenders defined earlier in the configuration while others can be dynamicall y created * Appenders defined earlier in the configuration while others can be dynamicall y created
skipping to change at line 86 skipping to change at line 87
final String name = getName(); final String name = getName();
if (name == null) { if (name == null) {
LOGGER.error("No name defined for this RoutingAppender"); LOGGER.error("No name defined for this RoutingAppender");
return null; return null;
} }
if (routes == null) { if (routes == null) {
LOGGER.error("No routes defined for RoutingAppender {}", name); LOGGER.error("No routes defined for RoutingAppender {}", name);
return null; return null;
} }
return new RoutingAppender(name, getFilter(), isIgnoreExceptions(), routes, rewritePolicy, return new RoutingAppender(name, getFilter(), isIgnoreExceptions(), routes, rewritePolicy,
getConfiguration(), purgePolicy, defaultRouteScript); getConfiguration(), purgePolicy, defaultRouteScript, getProp ertyArray());
} }
public Routes getRoutes() { public Routes getRoutes() {
return routes; return routes;
} }
public AbstractScript getDefaultRouteScript() { public AbstractScript getDefaultRouteScript() {
return defaultRouteScript; return defaultRouteScript;
} }
skipping to change at line 144 skipping to change at line 145
private Route defaultRoute; private Route defaultRoute;
private final Configuration configuration; private final Configuration configuration;
private final ConcurrentMap<String, AppenderControl> appenders = new Concurr entHashMap<>(); private final ConcurrentMap<String, AppenderControl> appenders = new Concurr entHashMap<>();
private final RewritePolicy rewritePolicy; private final RewritePolicy rewritePolicy;
private final PurgePolicy purgePolicy; private final PurgePolicy purgePolicy;
private final AbstractScript defaultRouteScript; private final AbstractScript defaultRouteScript;
private final ConcurrentMap<Object, Object> scriptStaticVariables = new Conc urrentHashMap<>(); private final ConcurrentMap<Object, Object> scriptStaticVariables = new Conc urrentHashMap<>();
private RoutingAppender(final String name, final Filter filter, final boolea n ignoreExceptions, final Routes routes, private RoutingAppender(final String name, final Filter filter, final boolea n ignoreExceptions, final Routes routes,
final RewritePolicy rewritePolicy, final Configuration configuration , final PurgePolicy purgePolicy, final RewritePolicy rewritePolicy, final Configuration configuration , final PurgePolicy purgePolicy,
final AbstractScript defaultRouteScript) { final AbstractScript defaultRouteScript, final Property[] properties
super(name, filter, null, ignoreExceptions); ) {
super(name, filter, null, ignoreExceptions, properties);
this.routes = routes; this.routes = routes;
this.configuration = configuration; this.configuration = configuration;
this.rewritePolicy = rewritePolicy; this.rewritePolicy = rewritePolicy;
this.purgePolicy = purgePolicy; this.purgePolicy = purgePolicy;
if (this.purgePolicy != null) { if (this.purgePolicy != null) {
this.purgePolicy.initialize(this); this.purgePolicy.initialize(this);
} }
this.defaultRouteScript = defaultRouteScript; this.defaultRouteScript = defaultRouteScript;
Route defRoute = null; Route defRoute = null;
for (final Route route : routes.getRoutes()) { for (final Route route : routes.getRoutes()) {
skipping to change at line 336 skipping to change at line 337
final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true); final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true);
if (name == null) { if (name == null) {
LOGGER.error("No name provided for RoutingAppender"); LOGGER.error("No name provided for RoutingAppender");
return null; return null;
} }
if (routes == null) { if (routes == null) {
LOGGER.error("No routes defined for RoutingAppender"); LOGGER.error("No routes defined for RoutingAppender");
return null; return null;
} }
return new RoutingAppender(name, filter, ignoreExceptions, routes, rewri tePolicy, config, purgePolicy, null); return new RoutingAppender(name, filter, ignoreExceptions, routes, rewri tePolicy, config, purgePolicy, null, null);
} }
public Route getDefaultRoute() { public Route getDefaultRoute() {
return defaultRoute; return defaultRoute;
} }
public AbstractScript getDefaultRouteScript() { public AbstractScript getDefaultRouteScript() {
return defaultRouteScript; return defaultRouteScript;
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)