@PluginFactory public static HiveEventCounter createInstance(@PluginAttribute("name") String name, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginElement("Layout") Layout layout, @PluginElement("Filters") Filter filter) { if (name == null) { name = APPENDER_NAME; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } return new HiveEventCounter(name, filter, layout, ignoreExceptions); }
@PluginFactory public static MemoryAppender createAppender( @PluginElement("Layout") Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter, @PluginAttribute("name") final String name, @PluginAttribute(value = "bufferSize", defaultInt = 500) final String bufferSize, @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final String ignore) { if (name == null) { LOGGER.error("No name provided for MemoryAppender"); return null; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } final int size = Integer.parseInt(bufferSize); final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true); return new MemoryAppender(name, filter, layout, ignoreExceptions, size); }
@PluginFactory public static HiveEventCounter createInstance(@PluginAttribute("name") String name, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginElement("Layout") Layout layout, @PluginElement("Filters") Filter filter) { if (name == null) { name = APPENDER_NAME; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } return new HiveEventCounter(name, filter, layout, ignoreExceptions); }
@PluginFactory public static BlockingAppender createAppender( @PluginAttribute("name") @Required(message = "No name provided for HangingAppender") final String name, @PluginElement("Layout") final Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter) { return new BlockingAppender(name); }
@PluginFactory public static UsesLoggingAppender createAppender( @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name, @PluginAttribute("ignoreExceptions") final boolean ignore, @PluginElement("Layout") final Layout<?> layout, @PluginElement("Filter") final Filter filter) { return new UsesLoggingAppender(name, filter, layout, ignore); }
private String name; @PluginElement("Layout") private Layout<? extends Serializable> layout; @PluginElement("Filter") private Filter filter;
@PluginFactory public static HangingAppender createAppender( @PluginAttribute("name") @Required(message = "No name provided for HangingAppender") final String name, @PluginAttribute("delay") final long delay, @PluginAttribute("startupDelay") final long startupDelay, @PluginAttribute("shutdownDelay") final long shutdownDelay, @PluginElement("Layout") final Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter) { return new HangingAppender(name, delay, startupDelay, shutdownDelay); }
private boolean raw; @PluginElement("Layout") private Layout<? extends Serializable> layout; @PluginElement("Filter") private Filter filter;
@PluginAttribute("bufferSize") final String bufferSizeStr, @PluginAttribute("ignoreExceptions") final String ignore, @PluginElement("Layout") Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter, @PluginAttribute("advertise") final String advertise, @PluginAttribute("advertiseURI") final String advertiseURI,
private String name; @PluginElement("Layout") private Layout<? extends Serializable> layout; @PluginElement("Filter") private Filter filter;
/** * Creates a CompositeTriggeringPolicy. * @param triggeringPolicy The triggering policies. * @return A CompositeTriggeringPolicy. */ @PluginFactory public static CompositeTriggeringPolicy createPolicy( @PluginElement("Policies") final TriggeringPolicy... triggeringPolicy) { return new CompositeTriggeringPolicy(triggeringPolicy); }
/** * Create a CompositeFilter. * * @param filters * An array of Filters to call. * @return The CompositeFilter. */ @PluginFactory public static CompositeFilter createFilters(@PluginElement("Filters") final Filter[] filters) { return new CompositeFilter(filters); }
/** * Create a CustomLevels object to contain all the CustomLevelConfigs. * * @param customLevels An array of CustomLevelConfigs. * @return A CustomLevels object. */ @PluginFactory public static CustomLevels createCustomLevels(// @PluginElement("CustomLevels") final CustomLevelConfig[] customLevels) { return new CustomLevels(customLevels == null ? new CustomLevelConfig[0] : customLevels); }
/** * Create a Composite PathCondition whose components all need to accept before this condition accepts. * * @param components The component filters. * @return A Composite PathCondition. */ @PluginFactory public static IfAll createAndCondition( @PluginElement("PathConditions") final PathCondition... components) { return new IfAll(components); }
/** * Create a Composite PathCondition: accepts if any of the nested conditions accepts. * * @param components The component conditions. * @return A Composite PathCondition. */ @PluginFactory public static IfAny createOrCondition( @PluginElement("PathConditions") final PathCondition... components) { return new IfAny(components); }
/** Create a new instance of the appender using the global spectator registry. */ @PluginFactory public static SpectatorAppender createAppender( @PluginAttribute("name") String name, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginElement("Layout") Layout<? extends Serializable> layout, @PluginElement("Filters") Filter filter) { if (name == null) { LOGGER.error("no name provided for SpectatorAppender"); return null; } return new SpectatorAppender(Spectator.globalRegistry(), name, filter, layout, ignoreExceptions); }
@PluginFactory public static GuiLogEventAppender createAppender(@PluginAttribute("name") String name, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginElement("Layout") Layout<? extends Serializable> layout, @PluginElement("Filters") Filter filter) { if (name == null) { LOGGER.error("No name provided for GuiLogEventAppender"); return null; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } return new GuiLogEventAppender(name, filter, layout, ignoreExceptions); }
@PluginFactory public static StreamAppender createAppender( @PluginAttribute("name") final String name, @PluginElement("Filter") final Filter filter, @PluginElement("Layout") Layout layout, @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final boolean ignoreExceptions, @PluginAttribute("streamName") String streamName) { return new StreamAppender(name, filter, layout, ignoreExceptions, streamName); }
@PluginFactory public static EventHubsAppender createAppender( @Required(message = "Provide a Name for EventHubs Log4j Appender") @PluginAttribute("name") final String name, @PluginElement("Filter") final Filter filter, @PluginElement("Layout") final Layout<? extends Serializable> layout, @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final boolean ignoreExceptions, @Required(message = "Provide EventHub connection string to append the events to") @PluginAttribute("eventHubConnectionString") final String connectionString, @PluginAttribute(value = "immediateFlush", defaultBoolean = false) final boolean immediateFlush) { final EventHubsManager eventHubsManager = new EventHubsManager(name, connectionString); return new EventHubsAppender(name, filter, layout, ignoreExceptions, eventHubsManager, immediateFlush); }
@PluginFactory public static MemoryAppender createAppender( @PluginAttribute("name") final String name, @PluginAttribute(value = "size", defaultInt = 10) final int size, @PluginElement("Filter") final Filter filter, @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final boolean ignoreExceptions) { return new MemoryAppender( name, size, filter, ignoreExceptions); }