Package org.apache.log4j

Examples of org.apache.log4j.SimpleLayout


        BasicConfigurator.DISABLE_OVERRIDE_KEY +
        "\" is set to ["+
      System.getProperty(BasicConfigurator.DISABLE_OVERRIDE_KEY)
        +"].");
   
       BasicConfigurator.configure(new ConsoleAppender(new SimpleLayout(),
             ConsoleAppender.SYSTEM_OUT));
    
    }
    else {
      PropertyConfigurator.configure(type);
View Full Code Here


    Appender appender = null
    Layout layout = null;
       
    if(layoutType.equals("simple"))
      layout = new SimpleLayout();
    else if(layoutType.equals("ttcc")) {
      layout = new TTCCLayout(AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT);
    }
    else
      Usage("Wrong layoutType [" + layoutType +"].");
View Full Code Here

  public
  void
  doConfigure(java.net.URL url, Hierarchy hierarchy) {
    Category.getRoot().addAppender(
        new ConsoleAppender(
            new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
  }
View Full Code Here

      System.err.println(e);
      Usage();
    }     

   
    ConsoleAppender appender = new ConsoleAppender(new SimpleLayout());
   
    if("false".equals(args[0])) {
      // nothing to do
    } else if ("true".equals(args[0])) {
      System.out.println("Flagging as shipped code.");
View Full Code Here

        BasicConfigurator.DISABLE_OVERRIDE_KEY +
        "\" is set to ["+
      System.getProperty(BasicConfigurator.DISABLE_OVERRIDE_KEY)
        +"].");
   
       BasicConfigurator.configure(new FileAppender(new SimpleLayout(),
             System.out));
    
    }
    else {
      PropertyConfigurator.configure(type);
View Full Code Here

      System.err.println(e);
      Usage();
    }     

   
    FileAppender appender = new FileAppender(new SimpleLayout(), System.err);
   
    if("false".equals(args[0]))
      ;      
    else if ("true".equals(args[0])) {
      System.out.println("Flagging as shipped code.");
View Full Code Here

        private final LinkedList<LoggingEvent> events = new LinkedList<LoggingEvent>();
        private int lineNumber;

        public LogRecorder( StringWriter writer ) {
            super(new SimpleLayout(), writer);
        }
View Full Code Here

  @Test(timeout=20000)
  public void testWarnCommandOpts() throws Exception {
    Logger logger = Logger.getLogger(YARNRunner.class);
   
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    Layout layout = new SimpleLayout();
    Appender appender = new WriterAppender(layout, bout);
    logger.addAppender(appender);
   
    JobConf jobConf = new JobConf();
   
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        Logger defaultLogger = Logger.getLogger(StopWatch.DEFAULT_LOGGER_NAME);
        ConsoleAppender stdErrAppender = new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_ERR);
        stdErrAppender.setName("log4jStdErrAppender");
        stdErrAppender.activateOptions();
        defaultLogger.addAppender(stdErrAppender);
    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
        // we add an appender explicitly to avoid getting a NOPLogger which permit logging;
        // otherwise the ExchangeFormatter wouldn't get called
        Logger.getLogger(LogCustomFormatterTest.class).removeAllAppenders();
        Logger.getLogger(LogCustomFormatterTest.class).addAppender(new ConsoleAppender(new SimpleLayout()));
        Logger.getLogger(LogCustomFormatterTest.class).setLevel(Level.TRACE);
    }
View Full Code Here

TOP

Related Classes of org.apache.log4j.SimpleLayout

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.