Package org.apache.log4j

Examples of org.apache.log4j.Logger.log()


    @Override
    public void rawMessage(String message, Throwable throwable, String logHierarchy)
    {
        Logger logger = Logger.getLogger(logHierarchy);
       
        logger.log(LEVEL, message, throwable);
    }
}
View Full Code Here


                        public <T extends Enum<?> & ModelUpdate> void update(T... changed) {
                            for (T t : changed){
                                Logger logger = LogManager.getLogger(loggerParam);
                                Level configuredLevel = logger.getLevel();
                                if(configuredLevel == null || configuredLevel.isGreaterOrEqual(level)){
                                    logger.log(level, t.toString() + ": " + fieldName, null);
                                }
                            }
                        }
                    };
                    model.bind(binding);
View Full Code Here

  }
 
  protected void log( final String messageToLog )
  {
      Logger log = Logger.getLogger( logger );
      log.log( level, messageToLog );
  }
 
  public Level getLevel()
  {
    return level;
View Full Code Here

            if (useLog4J) {
                Logger logger = getLogger(module);
                if (SYS_DEBUG != null) {
                    logger.setLevel(Level.DEBUG);
                }
                logger.log(callingClass, levelObjs[level], msg, t);
            } else {
                StringBuilder prefixBuf = new StringBuilder();

                prefixBuf.append(dateFormat.format(new java.util.Date()));
                prefixBuf.append(" [OFBiz");
View Full Code Here

        if (expectedJdkLevel == null)
            throw new AssertionError("Level not supported yet - have a bug !" + log4jLevel);
        if (!expectedJdkLevel.equals(jdkLogger.getLevel())) {
            jdkLogger.setLevel(expectedJdkLevel);
        }
        log4jLogger.log(record.getLoggerName(), LEVELS_JDK_TO_LOG4J.get(record.getLevel()), record.getMessage(), record.getThrown());
    }

    @Override
    public void flush() {
    }
View Full Code Here

    @Override
    public void rawMessage(String message, Throwable throwable, String logHierarchy)
    {
        Logger logger = Logger.getLogger(logHierarchy);
       
        logger.log(LEVEL, message, throwable);
    }
}
View Full Code Here

            if (useLog4J) {
                Logger logger = getLogger(module);
                if (SYS_DEBUG != null) {
                    logger.setLevel(Level.DEBUG);
                }
                logger.log(callingClass, levelObjs[level], msg, t);
            } else {
                StringBuilder prefixBuf = new StringBuilder();

                prefixBuf.append(dateFormat.format(new java.util.Date()));
                prefixBuf.append(" [OFBiz");
View Full Code Here

    Logger logger = LogManager.getLogger(TestLog4jAppender.class);
    for(int count = 0; count <= 1000; count++){
      int level = count % 5;
      String msg = "This is log message number" + String.valueOf(count);

      logger.log(Level.toLevel(level), msg);
      Transaction transaction = ch.getTransaction();
      transaction.begin();
      Event event = ch.take();
      Assert.assertNotNull(event);
      Assert.assertEquals(new String(event.getBody(), "UTF8"), msg);
View Full Code Here

       * default.
       */
      int level = ((count % 5)+1)*10000;
      String msg = "This is log message number" + String.valueOf(count);

      logger.log(Level.toLevel(level), msg);
      Transaction transaction = ch.getTransaction();
      transaction.begin();
      Event event = ch.take();
      Assert.assertNotNull(event);
      Assert.assertEquals(new String(event.getBody(), "UTF8"), msg);
View Full Code Here

       * default.
       */
      int level = ((count % 5)+1)*10000;
      String msg = "This is log message number" + String.valueOf(count);

      logger.log(Level.toLevel(level), msg);
      Transaction transaction = ch.getTransaction();
      transaction.begin();
      Event event = ch.take();
      Assert.assertNotNull(event);
      StringBuilder builder = new StringBuilder();
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.