Package org.tamacat.log.impl

Examples of org.tamacat.log.impl.Log4jLogger


     
    }
   
    @Test
    public void testGetDiagnosticContext() {
      assertTrue(LogFactory.getDiagnosticContext(new Log4jLogger("test")) instanceof Log4jDiagnosticContext);
      assertTrue(LogFactory.getDiagnosticContext(null) instanceof NoneDiagnosticContext);
    }
View Full Code Here


  @Test
  public void testSerialize() {
    ObjectOutputStream out = null;
    ObjectInputStream in = null;
    try {
      Log4jLogger logger = new Log4jLogger("TEST");
     
      //FileOutputStream os = new FileOutputStream("logger.ser");
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      out = new ObjectOutputStream(os);
      out.writeObject(logger);
      byte[] serialize = os.toByteArray();
      assertNotNull(serialize);
      //System.out.println(new String(serialize));
      logger.debug("Serialize OK. length=" + serialize.length);
     
      //FileInputStream is = new FileInputStream("logger.ser");
      ByteArrayInputStream is = new ByteArrayInputStream(serialize);
      in = new ObjectInputStream(is);
      Object obj = in.readObject();
      assertNotNull(obj);
      assertEquals(Log4jLogger.class, obj.getClass());
     
      logger = (Log4jLogger)obj;
      logger.debug("Deserialize OK.");
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    } finally {
      IOUtils.close(in);
View Full Code Here

    Log4jLogger logger;

    @Before
    public void setUp() throws Exception {
        logger = new Log4jLogger("TEST");
    }
View Full Code Here

            }
        } catch (Exception e) {
        }
        Class<?> loggerClass = ClassUtils.forName(LOG4J_CLASS);
        if (loggerClass != null) {
            return new Log4jLogger(name);
        } else {
            return new SimpleLogger();
        }
    }
View Full Code Here

TOP

Related Classes of org.tamacat.log.impl.Log4jLogger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.