Package org.apache.log4j

Examples of org.apache.log4j.ConsoleAppender$SystemOutStream


      Environment.getenv();
      if(Environment.debugging) {
        Logger rootLogger = Logger.getRootLogger();
        rootLogger.setLevel(Level.WARN);

        ConsoleAppender consoleAppender = null;
        for(Enumeration<Appender> e = (Enumeration<Appender>)rootLogger.getAllAppenders();
            e.hasMoreElements();) {
       
          Appender a = e.nextElement();
          if(a instanceof ConsoleAppender) {
            consoleAppender = (ConsoleAppender)a;
            break;
          }
        }
        if(consoleAppender != null) {
          Layout layout = consoleAppender.getLayout();
          if(layout instanceof PatternLayout) {
            PatternLayout consoleLayout = (PatternLayout)layout;
            consoleLayout.setConversionPattern("%d %-5p [%t] %l: %m%n");
          }
        }
View Full Code Here


      Logger rootLogger = Logger.getRootLogger();
      if(Environment.debugging) {
        rootLogger.setLevel(Level.WARN);
      }

      ConsoleAppender consoleAppender = null;
      for(Enumeration<Appender> e = (Enumeration<Appender>)rootLogger.getAllAppenders();
      e.hasMoreElements();) {

        Appender a = e.nextElement();
        if(a instanceof ConsoleAppender) {
          consoleAppender = (ConsoleAppender)a;
          break;
        }
      }
      if(consoleAppender != null) {
        Layout layout = consoleAppender.getLayout();
        if(layout instanceof PatternLayout) {
          PatternLayout consoleLayout = (PatternLayout)layout;
          consoleLayout.setConversionPattern("%d %-5p [%t] %l: %m%n");
        }
      }
View Full Code Here

        super.tearDown();
    }

    public void testLookup() throws Exception
    {
        ConsoleAppender app = new ConsoleAppender(new SimpleLayout());
        Log log = LogFactory.getLog("TestLogger");
        Logger logger = ((Log4JLogger)log).getLogger();
        logger.addAppender(app);
        logger.setLevel(Level.DEBUG);
        logger.setAdditivity(false);
View Full Code Here

   public void setUp() throws Exception
   {
      // Setup a console appender
      BasicConfigurator.resetConfiguration();
      PatternLayout layout = new PatternLayout("%r %-5p [%c{1}] %m%n");
      ConsoleAppender appender = new ConsoleAppender(layout);
      BasicConfigurator.configure(appender);
   }
View Full Code Here

      }

      // Setup by hand
      BasicConfigurator.resetConfiguration();
      PatternLayout layout = new PatternLayout("%r %-5p [%c{1}] %m%n");
      ConsoleAppender appender = new ConsoleAppender(layout);
      BasicConfigurator.configure(appender);
      file = System.getProperty("org.jboss.test.logfile");
      if (file != null)
      {
         FileAppender fileAppender = new FileAppender(layout, file);
View Full Code Here

         firstTime = false;
         Logger.getLogger("org.jboss.remoting").setLevel(Level.INFO);
         Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
         String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
         PatternLayout layout = new PatternLayout(pattern);
         ConsoleAppender consoleAppender = new ConsoleAppender(layout);
         Logger.getRootLogger().addAppender(consoleAppender)
      }
      InvokerRegistry.registerInvokerFactories(getTransport(), TestClientFactory.class, TestServerFactory.class);
      TestServerThread.threadCounter = 0;
   }
View Full Code Here

  private ConsoleAppender consoleAppender;
 
  private SystemLogger() {
    systemLogger = Logger.getLogger("System");
    /* System verbosity (Standard Out) */
    consoleAppender = new ConsoleAppender(new PatternLayout("%m"), ConsoleAppender.SYSTEM_ERR);
    consoleAppender.setEncoding("UTF-16");
    systemLogger.addAppender(consoleAppender);
    if (System.getProperty("Malt.verbosity") != null) {
      setSystemVerbosityLevel(System.getProperty("Malt.verbosity").toUpperCase());
    } else {
View Full Code Here

         firstTime = false;
         Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
         Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
         String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
         PatternLayout layout = new PatternLayout(pattern);
         ConsoleAppender consoleAppender = new ConsoleAppender(layout);
         Logger.getRootLogger().addAppender(consoleAppender)
      }
   }
View Full Code Here

         firstTime = false;
         Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
         Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
         String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
         PatternLayout layout = new PatternLayout(pattern);
         ConsoleAppender consoleAppender = new ConsoleAppender(layout);
         Logger.getRootLogger().addAppender(consoleAppender);
        
         InvokerRegistry.registerInvokerFactories("http", TransportClientFactory.class, TestCoyoteInvokerFactory.class);
      }
   }
View Full Code Here

         firstTime = false;
         Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
         Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
         String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
         PatternLayout layout = new PatternLayout(pattern);
         ConsoleAppender consoleAppender = new ConsoleAppender(layout);
         Logger.getRootLogger().addAppender(consoleAppender);        
      }
     
      String className = getClass().getName();
      int index = className.lastIndexOf('.');
View Full Code Here

TOP

Related Classes of org.apache.log4j.ConsoleAppender$SystemOutStream

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.