Package java.util.logging

Examples of java.util.logging.Logger$DefaultHandler


  /**
   * Refreshes the flags object.
   */
  public void refreshFlags() throws MessagingException {
    if (Thread.currentThread() != getFolderInfo().getFolderThread() && ! (Thread.currentThread() instanceof net.suberic.pooka.thread.LoadMessageThread)) {
      Logger folderLogger = getFolderInfo().getLogger();
      if (folderLogger.isLoggable(Level.WARNING)) {
        folderLogger.log(Level.WARNING, "Accessing Message Flags not on Folder Thread.");
        Thread.currentThread().dumpStack();

      }
    }
    getFolderInfo().refreshFlags(this);
View Full Code Here


  /**
   * Refreshes the Headers object.
   */
  public void refreshHeaders() throws MessagingException {
    if (Thread.currentThread() != getFolderInfo().getFolderThread() && ! (Thread.currentThread() instanceof net.suberic.pooka.thread.LoadMessageThread)) {
      Logger folderLogger = getFolderInfo().getLogger();
      if (folderLogger.isLoggable(Level.WARNING)) {
        folderLogger.log(Level.WARNING, "Accessing Message Headers not on Folder Thread.");
        Thread.currentThread().dumpStack();

      }
    }
    getFolderInfo().refreshHeaders(this);
View Full Code Here

   * This gets a particular property (From, To, Date, Subject, or just
   * about any Email Header) from the Message.
   */
  public Object getMessageProperty(String prop) throws MessagingException {
    if (getFolderInfo() != null && Thread.currentThread() != getFolderInfo().getFolderThread() && ! (Thread.currentThread() instanceof net.suberic.pooka.thread.LoadMessageThread)) {
      Logger folderLogger = getFolderInfo().getLogger();
      if (folderLogger.isLoggable(Level.WARNING)) {
        folderLogger.log(Level.WARNING, "Getting Message Property not on Folder Thread.");
        Thread.currentThread().dumpStack();

      }
    }
    Message msg = getMessage();
View Full Code Here

        if(_requestsCounter==0){
            UnicastRemoteObject.unexportObject(_registry, true);
            //System.gc();
            if(JODBConfig.DEBUG){
                printRegistryList();
                Logger logger = Utils.getLogger(getClass().getName());
                logger.log(Level.INFO,"Shutdown Registry - "+_registry);
            }
            _registry = null;
        }
    }
View Full Code Here

        }
    }
   
    public void printRegistryList() throws IOException{
        String[] regList = list();
        Logger logger = Utils.getLogger(getClass().getName());
        logger.log(Level.INFO,"Registry content <<<<<<<<<<<<<<<<<<<< ");
        for (int i = 0; regList !=null && i < regList.length; i++) {
            logger.log(Level.INFO,"Registry content -"+regList[i]);
        }
        logger.log(Level.INFO,"Registry content >>>>>>>>>>>>>>>>>>>> ");
    }
View Full Code Here

  private static final OLogManager  instance      = new OLogManager();
  private static final DateFormat    dateFormat    = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss:SSS");

  public OLogManager() {
    // ASSURE TO HAVE THE ORIENT LOG FORMATTER TO THE CONSOLE EVEN IF NO CONFIGURATION FILE IS TAKEN
    Logger log = Logger.getLogger("");
    if (log.getHandlers().length == 0) {
      // SET DEFAULT LOG FORMATTER
      Handler h = new ConsoleHandler();
      h.setFormatter(new OLogFormatter());
      log.addHandler(h);
    } else {
      for (Handler h : log.getHandlers()) {
        if (h instanceof ConsoleHandler && !h.getFormatter().getClass().equals(OLogFormatter.class))
          h.setFormatter(new OLogFormatter());
      }
    }
  }
View Full Code Here

  public void log(final Object iRequester, final Level iLevel, final String iMessage, final Throwable iException,
      final Object... iAdditionalArgs) {
    if (iMessage == null)
      return;

    final Logger log = iRequester != null ? Logger.getLogger(iRequester.getClass().getName()) : Logger.getLogger("");

    if (!log.isLoggable(iLevel))
      return;

    final StringBuilder buffer = new StringBuilder();
    buffer.append('\n');
    synchronized (dateFormat) {
      buffer.append(dateFormat.format(new Date()));
    }
    buffer.append(' ');
    buffer.append(iLevel.getName().substring(0, 4));
    if (iRequester != null) {
      buffer.append(" [");
      buffer.append(iRequester.getClass().getSimpleName());
      buffer.append(']');
    }
    buffer.append(' ');

    // FORMAT THE MESSAGE
    try {
      buffer.append(String.format(iMessage, iAdditionalArgs));
    } catch (Exception e) {
      buffer.append(iMessage);
    }

    if (iException != null)
      log.log(iLevel, buffer.toString(), iException);
    else
      log.log(iLevel, buffer.toString());
  }
View Full Code Here

        error = true;
        debug = info = warn = false;
      }
    }

    Logger log = Logger.getLogger("");
    for (Handler h : log.getHandlers()) {
      if (h.getClass().isAssignableFrom(iHandler)) {
        h.setLevel(level);
        break;
      }
    }
View Full Code Here

        final OutputStream os = message.getContent(OutputStream.class);
        final Writer iowriter = message.getContent(Writer.class);
        if (os == null && iowriter == null) {
            return;
        }
        Logger logger = getMessageLogger(message);
        if (logger.isLoggable(Level.INFO) || writer != null) {
            // Write the output while caching it for the log message
            boolean hasLogged = message.containsKey(LOG_SETUP);
            if (!hasLogged) {
                message.put(LOG_SETUP, Boolean.TRUE);
                if (os != null) {
View Full Code Here

        this(id, Phase.RECEIVE);
        this.writer = w;
    }
   
    public void handleMessage(Message message) throws Fault {
        Logger logger = getMessageLogger(message);
        if (writer != null || logger.isLoggable(Level.INFO)) {
            logging(logger, message);
        }
    }
View Full Code Here

TOP

Related Classes of java.util.logging.Logger$DefaultHandler

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.