Search in sources :

Example 21 with Logger

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

the class SimpleKeyFileTest method testGetLogger.

@Test
public void testGetLogger() throws Throwable {
    Logger logger = Logger.getLogger("testSimpleKeyFileName");
    SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
    simpleKeyFile.setLogger(logger, "testSimpleKeyFileRealm");
    Logger result = simpleKeyFile.getLogger();
    assertSame("result", logger, result);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 22 with Logger

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

the class DUKPTTest method initLogger.

private void initLogger() {
    Logger logger = new Logger();
    logger.addListener(new SimpleLogListener());
    log = new Log(logger, "SM Test");
}
Also used : SimpleLogListener(org.jpos.util.SimpleLogListener) Log(org.jpos.util.Log) Logger(org.jpos.util.Logger)

Example 23 with Logger

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

the class Q2 method getLog.

public Log getLog() {
    if (log == null) {
        Logger logger = Logger.getLogger(LOGGER_NAME);
        if (!hasSystemLogger && !logger.hasListeners() && cli == null)
            logger.addListener(new SimpleLogListener(System.out));
        log = new Log(logger, REALM);
    }
    return log;
}
Also used : SimpleLogListener(org.jpos.util.SimpleLogListener) Log(org.jpos.util.Log) Logger(org.jpos.util.Logger)

Example 24 with Logger

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

the class QFactory method setLogger.

public void setLogger(Object obj, Element e) {
    if (obj instanceof LogSource) {
        String loggerName = e.getAttributeValue("logger");
        if (loggerName != null) {
            String realm = e.getAttributeValue("realm");
            if (realm == null)
                realm = e.getName();
            Logger logger = Logger.getLogger(loggerName);
            ((LogSource) obj).setLogger(logger, realm);
        }
    }
}
Also used : LogSource(org.jpos.util.LogSource) Logger(org.jpos.util.Logger)

Example 25 with Logger

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

the class XMLPackagerTest method testSetLogger.

@Test
public void testSetLogger() throws Throwable {
    Logger logger = Logger.getLogger("testXMLPackagerName");
    xMLPackager.setLogger(logger, "testXMLPackagerRealm");
    assertSame("xMLPackager.logger", logger, xMLPackager.logger);
    assertEquals("xMLPackager.realm", "testXMLPackagerRealm", xMLPackager.realm);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Aggregations

Logger (org.jpos.util.Logger)45 Test (org.junit.Test)36 SimpleConfiguration (org.jpos.core.SimpleConfiguration)7 SubConfiguration (org.jpos.core.SubConfiguration)5 ISOMsg (org.jpos.iso.ISOMsg)5 SimpleLogListener (org.jpos.util.SimpleLogListener)5 Properties (java.util.Properties)4 Configuration (org.jpos.core.Configuration)4 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)4 ISOException (org.jpos.iso.ISOException)3 ConfigurationException (org.jpos.core.ConfigurationException)2 GZIPChannel (org.jpos.iso.channel.GZIPChannel)2 Log (org.jpos.util.Log)2 NameRegistrar (org.jpos.util.NameRegistrar)2 Before (org.junit.Before)2 PrintStream (java.io.PrintStream)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 IFA_LLLLCHAR (org.jpos.iso.IFA_LLLLCHAR)1 IFE_CHAR (org.jpos.iso.IFE_CHAR)1