ch.qos.logback.classic.net

## Class JMSQueueAppender

- java.lang.Object
- - ch.qos.logback.core.spi.ContextAwareBase
  - - ch.qos.logback.core.AppenderBase<E>
    - - ch.qos.logback.core.net.JMSAppenderBase<ILoggingEvent>
      - - ch.qos.logback.classic.net.JMSQueueAppender

All Implemented Interfaces:
  Appender<ILoggingEvent>, ContextAware, FilterAttachable<ILoggingEvent>, LifeCycle

    public class JMSQueueAppender
    extends JMSAppenderBase<ILoggingEvent>

A simple appender that publishes events to a JMS Queue. The events are serialized and transmitted as JMS message type `ObjectMessage`.

For more information about this appender, please refer to: http://logback.qos.ch/manual/appenders.html#JMSQueueAppender

Author:
  Ceki Gülcü

### Field Summary

### Fields inherited from class ch.qos.logback.core.net.JMSAppenderBase

`initialContextFactoryName, password, providerURL, securityCredentials, securityPrincipalName, urlPkgPrefixes, userName`

### Fields inherited from class ch.qos.logback.core.AppenderBase

`name, started`

### Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

`context`

### Constructor Summary

Constructors
Constructor and Description
`JMSQueueAppender()`

### Method Summary

Methods
`void` `append(ILoggingEvent event)` This method called by `AppenderBase.doAppend(E)` method to do most of the real appending work.
`java.lang.String` `getQueueBindingName()` Returns the value of the QueueBindingName option.
`protected javax.jms.QueueConnection` `getQueueConnection()` Returns the QueueConnection used for this appender.
`java.lang.String` `getQueueConnectionFactoryBindingName()` Returns the value of the QueueConnectionFactoryBindingName option.
`protected javax.jms.QueueSender` `getQueueSender()` Returns the QueueSender used for this appender.
`protected javax.jms.QueueSession` `getQueueSession()` Returns the QueueSession used for this appender.
`void` `setQueueBindingName(java.lang.String queueBindingName)` The QueueBindingName option takes a string value.
`void` `setQueueConnectionFactoryBindingName(java.lang.String qcfBindingName)` The QueueConnectionFactoryBindingName option takes a string value.
`void` `start()` Options are activated and become effective only after calling this method.
`void` `stop()` Close this JMSAppender.

### Methods inherited from class ch.qos.logback.core.net.JMSAppenderBase

`buildEnvProperties, buildJNDIContext, getInitialContextFactoryName, getPassword, getProviderURL, getSecurityCredentials, getSecurityPrincipalName, getURLPkgPrefixes, getUserName, lookup, setInitialContextFactoryName, setPassword, setProviderURL, setSecurityCredentials, setSecurityPrincipalName, setURLPkgPrefixes, setUserName`

### Methods inherited from class ch.qos.logback.core.AppenderBase

`addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString`

### Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface ch.qos.logback.core.spi.ContextAware

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext`

### Constructor Detail

#### JMSQueueAppender

    public JMSQueueAppender()

### Method Detail

#### setQueueConnectionFactoryBindingName

    public void setQueueConnectionFactoryBindingName(java.lang.String qcfBindingName)

The QueueConnectionFactoryBindingName option takes a string value. Its value will be used to lookup the appropriate `QueueConnectionFactory` from the JNDI context.

#### getQueueConnectionFactoryBindingName

    public java.lang.String getQueueConnectionFactoryBindingName()

Returns the value of the QueueConnectionFactoryBindingName option.

#### setQueueBindingName

    public void setQueueBindingName(java.lang.String queueBindingName)

The QueueBindingName option takes a string value. Its value will be used to lookup the appropriate `Queue` from the JNDI context.

#### getQueueBindingName

    public java.lang.String getQueueBindingName()

Returns the value of the QueueBindingName option.

#### start

    public void start()

Options are activated and become effective only after calling this method.

Specified by:
  `start` in interface `LifeCycle`
Overrides:
  `start` in class `AppenderBase<ILoggingEvent>`

#### stop

    public void stop()

Close this JMSAppender. Closing releases all resources used by the appender. A closed appender cannot be re-opened.

Specified by:
  `stop` in interface `LifeCycle`
Overrides:
  `stop` in class `AppenderBase<ILoggingEvent>`

#### append

    public void append(ILoggingEvent event)

This method called by `AppenderBase.doAppend(E)` method to do most of the real appending work.

Specified by:
  `append` in class `AppenderBase<ILoggingEvent>`

#### getQueueConnection

    protected javax.jms.QueueConnection getQueueConnection()

Returns the QueueConnection used for this appender. Only valid after start() method has been invoked.

#### getQueueSession

    protected javax.jms.QueueSession getQueueSession()

Returns the QueueSession used for this appender. Only valid after start() method has been invoked.

#### getQueueSender

    protected javax.jms.QueueSender getQueueSender()

Returns the QueueSender used for this appender. Only valid after start() method has been invoked.