/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
Context jndi = buildJNDIContext(); queueConnectionFactory = (QueueConnectionFactory) lookup(jndi, qcfBindingName); Queue queue = (Queue) lookup(jndi, queueBindingName); addError("Error while activating options for appender named [" + name + "].", e);
/** * Close this JMSAppender. Closing releases all resources used by the * appender. A closed appender cannot be re-opened. */ public synchronized void stop() { // The synchronized modifier avoids concurrent append and close operations if (!this.started) { return; } this.started = false; try { if (queueSession != null) { queueSession.close(); } if (queueConnection != null) { queueConnection.close(); } } catch (Exception e) { addError("Error while closing JMSAppender [" + name + "].", e); } // Help garbage collection queueSender = null; queueSession = null; queueConnection = null; }
/** * Close this JMSAppender. Closing releases all resources used by the * appender. A closed appender cannot be re-opened. */ public synchronized void stop() { // The synchronized modifier avoids concurrent append and close operations if (!this.started) { return; } this.started = false; try { if (queueSession != null) { queueSession.close(); } if (queueConnection != null) { queueConnection.close(); } } catch (Exception e) { addError("Error while closing JMSAppender [" + name + "].", e); } // Help garbage collection queueSender = null; queueSession = null; queueConnection = null; }
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
Context jndi = buildJNDIContext(); queueConnectionFactory = (QueueConnectionFactory) lookup(jndi, qcfBindingName); Queue queue = (Queue) lookup(jndi, queueBindingName); addError("Error while activating options for appender named [" + name + "].", e);
/** * Close this JMSAppender. Closing releases all resources used by the * appender. A closed appender cannot be re-opened. */ public synchronized void stop() { // The synchronized modifier avoids concurrent append and close operations if (!this.started) { return; } this.started = false; try { if (queueSession != null) { queueSession.close(); } if (queueConnection != null) { queueConnection.close(); } } catch (Exception e) { addError("Error while closing JMSAppender [" + name + "].", e); } // Help garbage collection queueSender = null; queueSession = null; queueConnection = null; }
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
Context jndi = buildJNDIContext(); queueConnectionFactory = (QueueConnectionFactory) lookup(jndi, qcfBindingName); Queue queue = (Queue) lookup(jndi, queueBindingName); addError("Error while activating options for appender named [" + name + "].", e);
/** * Close this JMSAppender. Closing releases all resources used by the * appender. A closed appender cannot be re-opened. */ public synchronized void stop() { // The synchronized modifier avoids concurrent append and close operations if (!this.started) { return; } this.started = false; try { if (queueSession != null) { queueSession.close(); } if (queueConnection != null) { queueConnection.close(); } } catch (Exception e) { addError("Error while closing JMSAppender [" + name + "].", e); } // Help garbage collection queueSender = null; queueSession = null; queueConnection = null; }
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
Context jndi = buildJNDIContext(); queueConnectionFactory = (QueueConnectionFactory) lookup(jndi, qcfBindingName); Queue queue = (Queue) lookup(jndi, queueBindingName); addError("Error while activating options for appender named [" + name + "].", e);