Java 类org.apache.logging.log4j.core.appender.rewrite.RewritePolicy 实例源码

项目:log4j2    文件:RoutingAppender.java   
private RoutingAppender(final String name, final Filter filter, final boolean ignoreExceptions, final Routes routes,
                        final RewritePolicy rewritePolicy, final Configuration config) {
    super(name, filter, null, ignoreExceptions);
    this.routes = routes;
    this.config = config;
    this.rewritePolicy = rewritePolicy;
    Route defRoute = null;
    for (final Route route : routes.getRoutes()) {
        if (route.getKey() == null) {
            if (defRoute == null) {
                defRoute = route;
            } else {
                error("Multiple default routes. Route " + route.toString() + " will be ignored");
            }
        }
    }
    defaultRoute = defRoute;
}
项目:log4j2    文件:RoutingAppender.java   
/**
 * Create a RoutingAppender.
 * @param name The name of the Appender.
 * @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise
 *               they are propagated to the caller.
 * @param routes The routing definitions.
 * @param config The Configuration (automatically added by the Configuration).
 * @param rewritePolicy A RewritePolicy, if any.
 * @param filter A Filter to restrict events processed by the Appender or null.
 * @return The RoutingAppender
 */
@PluginFactory
public static RoutingAppender createAppender(
        @PluginAttribute("name") final String name,
        @PluginAttribute("ignoreExceptions") final String ignore,
        @PluginElement("Routes") final Routes routes,
        @PluginConfiguration final Configuration config,
        @PluginElement("RewritePolicy") final RewritePolicy rewritePolicy,
        @PluginElement("Filters") final Filter filter) {

    final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true);
    if (name == null) {
        LOGGER.error("No name provided for RoutingAppender");
        return null;
    }
    if (routes == null) {
        LOGGER.error("No routes defined for RoutingAppender");
        return null;
    }
    return new RoutingAppender(name, filter, ignoreExceptions, routes, rewritePolicy, config);
}
项目:logging-log4j2    文件:RoutingAppender.java   
private RoutingAppender(final String name, final Filter filter, final boolean ignoreExceptions, final Routes routes,
        final RewritePolicy rewritePolicy, final Configuration configuration, final PurgePolicy purgePolicy,
        final AbstractScript defaultRouteScript) {
    super(name, filter, null, ignoreExceptions);
    this.routes = routes;
    this.configuration = configuration;
    this.rewritePolicy = rewritePolicy;
    this.purgePolicy = purgePolicy;
    if (this.purgePolicy != null) {
        this.purgePolicy.initialize(this);
    }
    this.defaultRouteScript = defaultRouteScript;
    Route defRoute = null;
    for (final Route route : routes.getRoutes()) {
        if (route.getKey() == null) {
            if (defRoute == null) {
                defRoute = route;
            } else {
                error("Multiple default routes. Route " + route.toString() + " will be ignored");
            }
        }
    }
    defaultRoute = defRoute;
}
项目:logging-log4j2    文件:RoutingAppender.java   
/**
 * Creates a RoutingAppender.
 * @param name The name of the Appender.
 * @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise
 *               they are propagated to the caller.
 * @param routes The routing definitions.
 * @param config The Configuration (automatically added by the Configuration).
 * @param rewritePolicy A RewritePolicy, if any.
 * @param filter A Filter to restrict events processed by the Appender or null.
 * @return The RoutingAppender
 * @deprecated Since 2.7; use {@link #newBuilder()}
 */
@Deprecated
public static RoutingAppender createAppender(
        final String name,
        final String ignore,
        final Routes routes,
        final Configuration config,
        final RewritePolicy rewritePolicy,
        final PurgePolicy purgePolicy,
        final Filter filter) {

    final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true);
    if (name == null) {
        LOGGER.error("No name provided for RoutingAppender");
        return null;
    }
    if (routes == null) {
        LOGGER.error("No routes defined for RoutingAppender");
        return null;
    }
    return new RoutingAppender(name, filter, ignoreExceptions, routes, rewritePolicy, config, purgePolicy, null);
}
项目:syncope    文件:TestFileRewriteAuditAppender.java   
@Override
public RewritePolicy getRewritePolicy() {
    return TestRewritePolicy.createPolicy();
}
项目:syncope    文件:AbstractAuditAppender.java   
@Override
public abstract RewritePolicy getRewritePolicy();
项目:syncope    文件:DefaultRewriteAuditAppender.java   
@Override
public RewritePolicy getRewritePolicy() {
    return PassThroughAuditRewritePolicy.createPolicy();
}
项目:syncope    文件:DefaultAuditAppender.java   
@Override
public RewritePolicy getRewritePolicy() {
    return null;
}
项目:logging-log4j2    文件:RoutingAppender.java   
public RewritePolicy getRewritePolicy() {
    return rewritePolicy;
}
项目:logging-log4j2    文件:RoutingAppender.java   
public B withRewritePolicy(@SuppressWarnings("hiding") final RewritePolicy rewritePolicy) {
    this.rewritePolicy = rewritePolicy;
    return asBuilder();
}
项目:logging-log4j2    文件:RoutingAppender.java   
public RewritePolicy getRewritePolicy() {
    return rewritePolicy;
}
项目:syncope    文件:AuditAppender.java   
RewritePolicy getRewritePolicy();