Examples of WriterTarget


Examples of org.apache.log.output.io.WriterTarget

                setPriority(appProperties.getProperty(prop), category);
            }
            if (prop.startsWith(LOG_FILE + ".")) { //$NON_NLS-1$
                String category = prop.substring(LOG_FILE.length() + 1);
                String file = appProperties.getProperty(prop);
                setTarget(new WriterTarget(makeWriter(file, prop), getFormat()), category);
            }
        }
    }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

        }
        Hierarchy.getDefaultHierarchy().setDefaultLogTarget(target);
    }

    private static LogTarget getTarget(Writer targetFile, PatternFormatter fmt) {
        return new WriterTarget(targetFile, fmt);
    }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

      }
      if (prop.startsWith(LOG_FILE+"."))
      {
        String category = prop.substring(LOG_FILE.length() + 1);
        String file = appProperties.getProperty(prop);
        setTarget(new WriterTarget(makeWriter(file,prop),format),category);
      }
    }
  }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

   */
  public static void setTarget(Writer targetFile)
  {
    if (target == null)
    {
      target = new WriterTarget(targetFile, format);
    }
    else
    {
      if(target instanceof WriterTarget)
      {
        ((WriterTarget)target).close();
      }
      target = new WriterTarget(targetFile, format);
    }
    Hierarchy.getDefaultHierarchy().setDefaultLogTarget(target);
  }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

                setPriority(appProperties.getProperty(prop), category);
            }
            if (prop.startsWith(LOG_FILE + ".")) { //$NON_NLS-1$
                String category = prop.substring(LOG_FILE.length() + 1);
                String file = appProperties.getProperty(prop);
                setTarget(new WriterTarget(makeWriter(file, prop), getFormat()), category);
            }
        }
    }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

        }
        Hierarchy.getDefaultHierarchy().setDefaultLogTarget(target);
    }

    private static LogTarget getTarget(Writer targetFile, PatternFormatter fmt) {
        return new WriterTarget(targetFile, fmt);
    }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

    public void testWriterTarget()
        throws Exception
    {
        final ByteArrayOutputStream output = new ByteArrayOutputStream();
        final OutputStreamWriter writer = new OutputStreamWriter( output );
        final WriterTarget target = new WriterTarget( writer, FORMATTER );
        doStreamTest( output, target );
    }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

        private StringWriter wr = null;
       
        public void divertLog()
        {
      wr=new StringWriter(1000);
      LogTarget [] lt = {new WriterTarget(wr,fmt)};
      log.setLogTargets(lt);
        }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

    public void testWriterTarget()
        throws Exception
    {
        final ByteArrayOutputStream output = new ByteArrayOutputStream();
        final OutputStreamWriter writer = new OutputStreamWriter( output );
        final WriterTarget target = new WriterTarget( writer, FORMATTER );
        doStreamTest( output, target );
    }
View Full Code Here

Examples of org.apache.log.output.io.WriterTarget

        private StringWriter wr = null;

        private void divertLog() {// N.B. This needs to divert the log for SampleResult
            wr = new StringWriter(1000);
            LogTarget[] lt = { new WriterTarget(wr, fmt) };
            SampleResult.log.setLogTargets(lt);
        }
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.