Search in sources :

Example 1 with LogListener

use of org.jpos.util.LogListener in project jPOS by jpos.

the class LoggerAdaptor method addListener.

private void addListener(Element e) throws ConfigurationException {
    QFactory factory = getServer().getFactory();
    String clazz = e.getAttributeValue("class");
    LogListener listener = (LogListener) factory.newInstance(clazz);
    if (listener instanceof Configurable) {
        try {
            ((Configurable) listener).setConfiguration(factory.getConfiguration(e));
        } catch (ConfigurationException ex) {
            throw new ConfigurationException(ex);
        }
    }
    logger.addListener(listener);
}
Also used : LogListener(org.jpos.util.LogListener) ConfigurationException(org.jpos.core.ConfigurationException) QFactory(org.jpos.q2.QFactory) Configurable(org.jpos.core.Configurable)

Aggregations

Configurable (org.jpos.core.Configurable)1 ConfigurationException (org.jpos.core.ConfigurationException)1 QFactory (org.jpos.q2.QFactory)1 LogListener (org.jpos.util.LogListener)1