Examples of Log4JLogger


Examples of org.codehaus.dna.impl.Log4JLogger

    {
        final Logger log4jLogger = Logger.getLogger( "test" );
        log4jLogger.removeAllAppenders();
        log4jLogger.addAppender( target );
        log4jLogger.setLevel( priority );
        return new Log4JLogger( log4jLogger );
    }
View Full Code Here

Examples of org.datanucleus.util.Log4JLogger

  }

  public static void setDatanucleusLoggerLevel(NucleusLogger nucleusLogger,
      Field log4jLoggerField, Level level) {
    if (nucleusLogger instanceof Log4JLogger) {
      Log4JLogger log4jLogger = (Log4JLogger) nucleusLogger;
      org.apache.log4j.Logger logger;
      try {
        logger = (org.apache.log4j.Logger) log4jLoggerField.get(nucleusLogger);
      } catch (IllegalAccessException e) {
        LOG.error("Could not access field logger from Log4jLogger");
View Full Code Here

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

Examples of org.tamacat.log.impl.Log4jLogger

  @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

Examples of org.tamacat.log.impl.Log4jLogger

    Log4jLogger logger;

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

Examples of org.tamacat.log.impl.Log4jLogger

            }
        } 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
Copyright © 2018 www.massapi.com. 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.