Package org.apache.log4j

Examples of org.apache.log4j.ConsoleAppender$SystemErrStream


          else
          {
            if( ! (con instanceof ConsoleAppender) )
            {
              Logger.getRootLogger().removeAppender(con);
              con = new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN));
              con.setName("ConsoleAppender");
                Logger.getRootLogger().addAppender(con);
            }
            // switch back to console appender
            ci.out.println("> Console logging on");
View Full Code Here


  }
 
  public static void initRootLogger() {
    if (Logger.getRootLogger().getAppender("ConsoleAppender")==null) {
      Appender app;
      app = new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN));
      app.setName("ConsoleAppender");
      app.addFilter( new DenyAllFilter() )//'log off' by default
      Logger.getRootLogger().addAppender(app);
    }
  }
View Full Code Here

    this.controlling   = false;
    this.br       = new CommandReader( new InputStreamReader( new ByteArrayInputStream(new byte[0])));
       
    if (Logger.getRootLogger().getAppender("ConsoleAppender")==null) {
        Appender app;
        app = new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN));
        app.setName("ConsoleAppender");
        app.addFilter( new DenyAllFilter() )//'log off' by default
        Logger.getRootLogger().addAppender(app);
      }
   
View Full Code Here

            String consoleLevel = System.getProperty(consoleLogLevelProperty, "DEBUG");
            String fileLevel = System.getProperty(fileLogLevelProperty, "DEBUG");
            String fileName = System.getProperty(filenameLogLevelProperty);

            // console appender level configuration
            ConsoleAppender consoleAppender = (ConsoleAppender) Logger.getRootLogger().getAppender(
                    CONSOLE_APPENDER_NAME);
            if (consoleAppender != null) {
                Level consoleThreshold = Level.toLevel(consoleLevel, Level.DEBUG);
                consoleAppender.setThreshold(consoleThreshold);
                LOG.debug("Console LOG level set to " + consoleThreshold);
            }

            if (fileName != null) {
                PatternLayout layout = new PatternLayout("%d{ABSOLUTE} %-5p %x %m%n");
View Full Code Here

      String serviceName = args.length == 3 ? args[2] : "srp-test/SRPServerInterface";

      // Set up a simple configuration that logs on the console.
      Logger root = Logger.getRootLogger();
      root.setLevel(Level.TRACE);
      root.addAppender(new ConsoleAppender(new PatternLayout("%x%m%n")));

      InitialContext ctx = new InitialContext();
      SRPServerInterface server = (SRPServerInterface) ctx.lookup(serviceName);
      System.out.println("Found SRPServerInterface, "+server);
      SRPParameters params = server.getSRPParameters(username);
View Full Code Here

   protected void setUp() throws Exception
   {
      // Set up a simple configuration that logs on the console.
      Logger root = Logger.getRootLogger();
      root.setLevel(Level.TRACE);
      root.addAppender(new ConsoleAppender(new PatternLayout("%x%m%n")));
      Util.init();
      NDC.push("S,");
      server = new TstImpl(password, "123456");
      NDC.pop();
      NDC.remove();
View Full Code Here

       * hier jetzt direkt konfigurieren
       */
      try {
        SimpleLayout layout = new SimpleLayout();
        // Appender consoleAppender = new JobSchedulerLog4JAppender(layout);
        Appender consoleAppender = new ConsoleAppender(layout);
        objRootLog.addAppender(consoleAppender);
        // ALL | DEBUG | INFO | WARN | ERROR | FATAL | OFF:
        objRootLog.setLevel(Level.DEBUG);
        objRootLog.debug("Log4J configured programmatically");
      }
View Full Code Here

    String mySource = "the source";

    // create an NTEventLogAppender
    NTEventLogAppender eventLogAppender = new NTEventLogAppender(mySource,myLayout);
    //create a console appender 
    ConsoleAppender consoleAppender = new ConsoleAppender(myLayout);
   
    // associate the appenders to the logger
    myLogger.addAppender(consoleAppender);
    myLogger.addAppender(eventLogAppender);
View Full Code Here

    private static org.apache.log4j.Logger getFallabckLogger() {
        org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("OpenEJB.logging");

        SimpleLayout simpleLayout = new SimpleLayout();
        ConsoleAppender newAppender = new ConsoleAppender(simpleLayout);
        logger.addAppender(newAppender);
        return logger;
    }
View Full Code Here

            copyToOutput("/META-INF/NOTICE.txt");
        } else if (command.hasOption("license")) {
            copyToOutput("/META-INF/LICENSE.txt");
        } else if (command.hasOption("cli")) {
            Logger logger = Logger.getRootLogger();
            logger.addAppender(new ConsoleAppender(new PatternLayout("%p %m%n")));
            logger.setLevel(Level.WARN);

            String uri = command.getOptionValue("cli");
            Repository repository = JcrUtils.getRepository(uri);
View Full Code Here

TOP

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

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.