org.apache.logging.log4j.core.ErrorHandler Java Examples
The following examples show how to use
org.apache.logging.log4j.core.ErrorHandler.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RocketmqLog4j2Appender.java From DDMQ with Apache License 2.0 | 6 votes |
/** * When system exit,this method will be called to close resources */ public boolean stop(long timeout, TimeUnit timeUnit) { this.setStopping(); try { ProducerInstance.getProducerInstance().removeAndClose(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Closeing RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } boolean stopped = super.stop(timeout, timeUnit, false); this.setStopped(); return stopped; }
Example #2
Source File: RocketmqLog4j2Appender.java From rocketmq with Apache License 2.0 | 6 votes |
/** * When system exit,this method will be called to close resources */ public boolean stop(long timeout, TimeUnit timeUnit) { this.setStopping(); try { ProducerInstance.getProducerInstance().removeAndClose(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Closeing RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } boolean stopped = super.stop(timeout, timeUnit, false); this.setStopped(); return stopped; }
Example #3
Source File: RocketmqLog4j2Appender.java From rocketmq with Apache License 2.0 | 6 votes |
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, String nameServerAddress, String producerGroup, String topic, String tag) { super(name, filter, layout, ignoreExceptions); this.producer = producer; this.topic = topic; this.tag = tag; this.nameServerAddress = nameServerAddress; this.producerGroup = producerGroup; try { this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Starting RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } }
Example #4
Source File: RocketmqLog4j2Appender.java From rocketmq-all-4.1.0-incubating with Apache License 2.0 | 6 votes |
/** * When system exit,this method will be called to close resources * * @param timeout * @param timeUnit * @return */ public boolean stop(long timeout, TimeUnit timeUnit) { this.setStopping(); try { ProducerInstance.removeAndClose(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Closeing RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } boolean stopped = super.stop(timeout, timeUnit, false); this.setStopped(); return stopped; }
Example #5
Source File: RocketmqLog4j2Appender.java From rocketmq-all-4.1.0-incubating with Apache License 2.0 | 6 votes |
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, String nameServerAddress, String producerGroup, String topic, String tag) { super(name, filter, layout, ignoreExceptions); this.producer = producer; this.topic = topic; this.tag = tag; this.nameServerAddress = nameServerAddress; this.producerGroup = producerGroup; try { this.producer = ProducerInstance.getInstance(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Starting RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } }
Example #6
Source File: RocketmqLog4j2Appender.java From DDMQ with Apache License 2.0 | 6 votes |
/** * When system exit,this method will be called to close resources */ public boolean stop(long timeout, TimeUnit timeUnit) { this.setStopping(); try { ProducerInstance.getProducerInstance().removeAndClose(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Closeing RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } boolean stopped = super.stop(timeout, timeUnit, false); this.setStopped(); return stopped; }
Example #7
Source File: RocketmqLog4j2Appender.java From DDMQ with Apache License 2.0 | 6 votes |
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, String nameServerAddress, String producerGroup, String topic, String tag) { super(name, filter, layout, ignoreExceptions); this.producer = producer; this.topic = topic; this.tag = tag; this.nameServerAddress = nameServerAddress; this.producerGroup = producerGroup; try { this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Starting RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } }
Example #8
Source File: RocketmqLog4j2Appender.java From rocketmq-read with Apache License 2.0 | 6 votes |
/** * When system exit,this method will be called to close resources */ public boolean stop(long timeout, TimeUnit timeUnit) { this.setStopping(); try { ProducerInstance.getProducerInstance().removeAndClose(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Closeing RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } boolean stopped = super.stop(timeout, timeUnit, false); this.setStopped(); return stopped; }
Example #9
Source File: RocketmqLog4j2Appender.java From rocketmq-read with Apache License 2.0 | 6 votes |
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, String nameServerAddress, String producerGroup, String topic, String tag) { super(name, filter, layout, ignoreExceptions); this.producer = producer; this.topic = topic; this.tag = tag; this.nameServerAddress = nameServerAddress; this.producerGroup = producerGroup; try { this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Starting RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } }
Example #10
Source File: RocketmqLog4j2Appender.java From rocketmq-4.3.0 with Apache License 2.0 | 6 votes |
/** * When system exit,this method will be called to close resources 当系统退出时,将调用此方法来关闭资源 */ public boolean stop(long timeout, TimeUnit timeUnit) { this.setStopping(); try { ProducerInstance.getProducerInstance().removeAndClose(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Closeing RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } boolean stopped = super.stop(timeout, timeUnit, false); this.setStopped(); return stopped; }
Example #11
Source File: RocketmqLog4j2Appender.java From rocketmq-4.3.0 with Apache License 2.0 | 6 votes |
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, String nameServerAddress, String producerGroup, String topic, String tag) { super(name, filter, layout, ignoreExceptions); this.producer = producer; this.topic = topic; this.tag = tag; this.nameServerAddress = nameServerAddress; this.producerGroup = producerGroup; try { this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Starting RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } }
Example #12
Source File: RocketmqLog4j2Appender.java From DDMQ with Apache License 2.0 | 6 votes |
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, String nameServerAddress, String producerGroup, String topic, String tag) { super(name, filter, layout, ignoreExceptions); this.producer = producer; this.topic = topic; this.tag = tag; this.nameServerAddress = nameServerAddress; this.producerGroup = producerGroup; try { this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup); } catch (Exception e) { ErrorHandler handler = this.getHandler(); if (handler != null) { handler.error("Starting RocketmqLog4j2Appender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } } }
Example #13
Source File: AbstractAppender.java From logging-log4j2 with Apache License 2.0 | 5 votes |
/** * The handler must be set before the appender is started. * * @param handler The ErrorHandler to use. */ @Override public void setHandler(final ErrorHandler handler) { if (handler == null) { LOGGER.error("The handler cannot be set to null"); return; } if (isStarted()) { LOGGER.error("The handler cannot be changed once the appender is started"); return; } this.handler = handler; }
Example #14
Source File: ConsoleAppenderBuilderTest.java From logging-log4j2 with Apache License 2.0 | 5 votes |
/** * Tests https://issues.apache.org/jira/browse/LOG4J2-2441 */ @Test public void testSetNullErrorHandlerIsNotAllowed() { final ConsoleAppender appender = ConsoleAppender.newBuilder().setName("test").build(); ErrorHandler handler = appender.getHandler(); Assert.assertNotNull(handler); // This could likely be allowed to throw, but we're just testing that // setting null does not actually set a null handler. appender.setHandler(null); Assert.assertSame(handler, appender.getHandler()); }
Example #15
Source File: TestAppender.java From JVoiceXML with GNU Lesser General Public License v2.1 | 4 votes |
/** * {@inheritDoc} */ public ErrorHandler getErrorHandler() { return null; }
Example #16
Source File: TestAppender.java From JVoiceXML with GNU Lesser General Public License v2.1 | 4 votes |
@Override public ErrorHandler getHandler() { // TODO Auto-generated method stub return null; }
Example #17
Source File: TestAppender.java From JVoiceXML with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void setHandler(ErrorHandler handler) { // TODO Auto-generated method stub }
Example #18
Source File: StreamHandlerAppender.java From Bukkit-SSHD with Apache License 2.0 | 4 votes |
@Override public ErrorHandler getHandler() { return null; }
Example #19
Source File: TestAppender.java From JVoiceXML with GNU Lesser General Public License v2.1 | 2 votes |
/** * {@inheritDoc} */ public void setErrorHandler(final ErrorHandler handler) { }
Example #20
Source File: StreamHandlerAppender.java From Bukkit-SSHD with Apache License 2.0 | 2 votes |
@Override public void setHandler(ErrorHandler errorHandler) { }
Example #21
Source File: AbstractAppender.java From logging-log4j2 with Apache License 2.0 | 2 votes |
/** * Returns the ErrorHandler, if any. * * @return The ErrorHandler. */ @Override public ErrorHandler getHandler() { return handler; }