Package org.apache.log4j

Examples of org.apache.log4j.WriterAppender$DefaultErrorHandler


   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 WriterAppender(new PatternLayout("%x%m%n"), System.out));
       Util.init();
       NDC.push("S,");
       server = new SimpleSRPServer(password, "123456");
       NDC.pop();
       NDC.remove();
View Full Code Here


   TestJCEIntegration() throws Exception
   {
      // Set up a simple configuration that logs on the console.
      Logger root = Logger.getRootLogger();
      root.setLevel(Level.TRACE);
      root.addAppender(new WriterAppender(new PatternLayout("%x%m%n"), System.out));
      Util.init();
      NDC.push("S,");
      server = new SimpleSRPServer("secret".toCharArray(), "123456");
      NDC.pop();
      NDC.remove();
View Full Code Here

    logViewerVC.contextPut("loggingPackage", loggingPackage);
    // Create logger for requested package and add a string writer appender
    log4JLogger = Logger.getLogger(loggingPackage);
    writer = new StringWriter();
    Layout layout = new PatternLayout("%d{HH:mm:ss} %-5p [%t]: %m%n");
    writerAppender = new WriterAppender(layout, writer);
    writerAppender.setThreshold(level);
    log4JLogger.addAppender(writerAppender);
    updateLogViewFromWriter();
    // Add job to read from the string writer every second
    try {
View Full Code Here

  @Before
  public void setUp() {
    this.stdStream = new ByteArrayOutputStream(1000);
    this.l4jLogger = org.apache.log4j.Logger.getLogger(LOGGER_NAME);

    WriterAppender appender = new WriterAppender(new SimpleLayout(),
        this.stdStream);
    this.l4jLogger.addAppender(appender);
    appender.setImmediateFlush(true);

    this.l4jLogger.setLevel(org.apache.log4j.Level.ALL);

    try {
      LoggerFactory.setType(Log4jLogger.class.getName(), this.getClass()
View Full Code Here

*/
public class TikaCLI {

    public static void main(String[] args) throws Exception {
        BasicConfigurator.configure(
                new WriterAppender(new SimpleLayout(), System.err));
        Logger.getRootLogger().setLevel(Level.INFO);

        TikaCLI cli = new TikaCLI();
        for (int i = 0; i < args.length; i++) {
            cli.process(args[i]);
View Full Code Here

    public void testMultiTenentConfiguration3() throws Exception
    {
        factory.setFile(MULTI_TENENT_FILE);
        StringWriter writer = new StringWriter();
        WriterAppender app = new WriterAppender(new SimpleLayout(), writer);
        Log log = LogFactory.getLog("TestLogger");
        Logger logger = ((Log4JLogger)log).getLogger();
        logger.addAppender(app);
        logger.setLevel(Level.DEBUG);
        logger.setAdditivity(false);
View Full Code Here

    @Test
    public void testMultiTenentConfiguration3() throws Exception
    {
        factory.setFile(MULTI_TENENT_FILE);
        StringWriter writer = new StringWriter();
        WriterAppender app = new WriterAppender(new SimpleLayout(), writer);
        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 testFileDeletion() throws Exception
    {
        Logger logger = Logger.getLogger(FileChangedReloadingStrategy.class.getName());
        Layout layout = new PatternLayout("%p - %m%n");
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        Appender appender = new WriterAppender(layout, os);
        logger.addAppender(appender);
        logger.setLevel(Level.WARN);
        logger.setAdditivity(false);
        // create a new configuration
        File file = new File("target/testReload.properties");
View Full Code Here

*/
public class TikaCLI {

    public static void main(String[] args) throws Exception {
        BasicConfigurator.configure(
                new WriterAppender(new SimpleLayout(), System.err));
        Logger.getRootLogger().setLevel(Level.INFO);

        TikaCLI cli = new TikaCLI();
        for (int i = 0; i < args.length; i++) {
            cli.process(args[i]);
View Full Code Here

    private static final Log logger = LogFactory.getLog(TikaCLI.class);

    public static void main(String[] args) throws Exception {
        BasicConfigurator.configure(
                new WriterAppender(new SimpleLayout(), System.err));
        Logger.getRootLogger().setLevel(Level.INFO);

        TikaCLI cli = new TikaCLI();
        if (args.length > 0) {
            for (int i = 0; i < args.length; i++) {
View Full Code Here

TOP

Related Classes of org.apache.log4j.WriterAppender$DefaultErrorHandler

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.