Package com.toc.logging.config

Examples of com.toc.logging.config.WriterConfig


    try {
      // If the writers map is null, initial the writers map.
      if(writers == null) {
        writers = new HashMap<String,WriterConfig>();
      }
      writers.put(name, new WriterConfig(domain, target, output, pattern,
          datePattern, filePath, logPath, fileName,
          maxFileSize, separateFrequency, stream, enabled, wellFormat));
    } catch(Exception e) {
      throw ExceptionHelper.parse(e);
    }   
View Full Code Here


   * Constrain a new Log object without configuration object.
   * @throws GenericException Throw the GenericException, refer to com.toc.lib.exception.GenericException.
   */
  public Log() throws GenericException {
    try {
      defaultWriter = new ConsoleWriter(new WriterConfig());
      writers = new ArrayList<Writer>();
      config = new Configuration();
      loadConfig(config);
    } catch(Exception e) {
      e.printStackTrace();
View Full Code Here

   * @param config {@link com.toc.logging.Configuration}
   * @throws GenericException Throw the GenericException, refer to com.toc.lib.exception.GenericException.
   */
  public Log(Configuration config) throws GenericException {
    try {
      defaultWriter = new ConsoleWriter(new WriterConfig());
      writers = new ArrayList<Writer>();
      loadConfig(config);
   } catch(Exception e) {
     e.printStackTrace();
    }
View Full Code Here

      this.config = config;
      this.enabled = config.isEnabled();
      writers.clear();
      if(config.getWriters() != null && config.getWriters().size() > 0) {
        for(Iterator<WriterConfig> it = config.getWriters().values().iterator(); it.hasNext();) {
          WriterConfig writerConfig = it.next();
          writers.addAll(WriterFactory.create(writerConfig));
        }
      } else {
        //If no writer is defined in the configuration object, use default writer.
        writers.add(defaultWriter);
View Full Code Here

TOP

Related Classes of com.toc.logging.config.WriterConfig

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.