I have added the above appeder in my log4j2.xml as: (I have added new appender package name in "packages" attribute in configuration element)/*** An Appender that delivers events over socket connections. Supports HTTP.*/@Plugin(name = "HTTPSocket", category = "Core", elementType = "appender", printObject = true)public class HTTPSocketAppender extends AbstractOutputStreamAppender<AbstractSocketManager> {protected HTTPSocketAppender(String name, Layout<? extends Serializable> layout, Filter filter,boolean ignoreExceptions, boolean immediateFlush, AbstractSocketManager manager) {super(name, layout, filter, ignoreExceptions, immediateFlush, manager);}@Overridepublic void stop() {super.stop();}@PluginFactorypublic static HTTPSocketAppender createAppender(// @formatter:off@PluginAttribute("host") final String host,@PluginAttribute(value = "port", defaultInt = 0) final int port,@PluginAttribute(value = "connectTimeoutMillis", defaultInt = 0) final int connectTimeoutMillis,@PluginAttribute("name") final String name,@PluginAttribute(value = "immediateFlush", defaultBoolean = true) boolean immediateFlush,@PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final boolean ignoreExceptions,@PluginElement("Layout") Layout<? extends Serializable> layout,@PluginElement("Filter") final Filter filter) {// @formatter:onif (layout == null) {layout = SerializedLayout.createLayout();}if (name == null) {LOGGER.error("No name provided for HTTPAppender");return null;}immediateFlush = true;final AbstractSocketManager manager = createSocketManager(name, host, port, connectTimeoutMillis,layout);return new HTTPSocketAppender(name, layout, filter, ignoreExceptions, immediateFlush, manager);}/*** Creates an AbstractSocketManager.** @throws IllegalArgumentException if the protocol cannot be handled.*/protected static AbstractSocketManager createSocketManager(final String name, final String host,final int port, final int connectTimeoutMillis, final Layout<? extends Serializable> layout) {return HTTPSocketManager.getSocketManager(host, port, connectTimeoutMillis, layout);}
--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com
---
You received this message because you are subscribed to a topic in the Google Groups "OPS4J" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ops4j/QvSOAmOrACg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ops4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.