Examples of LogRecord


Examples of java.util.logging.LogRecord

  public boolean isWarn() {
    return logger.isLoggable(Level.WARNING);
  }

  public void log (ILoggerLevel level, String message) {
    this.log(new LogRecord(framework.getLevel(level), message));
  }
View Full Code Here

Examples of java.util.logging.LogRecord

  public void log (ILoggerLevel level, String message) {
    this.log(new LogRecord(framework.getLevel(level), message));
  }
 
  public void log (ILoggerLevel level, String message, Throwable throwable) {
    this.log(new LogRecord(framework.getLevel(level), message + ThrowableUtil.toString(throwable)));
  }
View Full Code Here

Examples of java.util.logging.LogRecord

    public static class PropertyVetoExceptionThatNetBeansLikes extends PropertyVetoException implements Callable {
        public PropertyVetoExceptionThatNetBeansLikes(String mess, PropertyChangeEvent evt)  {
            super(mess, evt);
        }
        public Object call() throws Exception {
            LogRecord lg = new LogRecord(Level.ALL, getMessage());
            lg.setResourceBundle(new ListResourceBundle() {
                protected Object[][] getContents() {
                    return new Object[][] { {getMessage(), getMessage()} };
                }
            });
            return new LogRecord[] { lg };
View Full Code Here

Examples of java.util.logging.LogRecord

        if (writer != null) {
            writer.println(message);
            // Flushing the writer to make sure the message is written
            writer.flush();
        } else if (logger.isLoggable(Level.INFO)) {
            LogRecord lr = new LogRecord(Level.INFO, message);
            lr.setSourceClassName(logger.getName());
            lr.setSourceMethodName(null);
            lr.setLoggerName(logger.getName());
            logger.log(lr);
        }
    }
View Full Code Here

Examples of java.util.logging.LogRecord

      });
      fail();
    } catch (CreationException expected) {
    }

    LogRecord logRecord = Iterables.getOnlyElement(this.logRecords);
    assertContains(logRecord.getMessage(),
        "An exception was caught and reported. Message: java.lang.IllegalArgumentException");
  }
View Full Code Here

Examples of java.util.logging.LogRecord

                    msg,
                    t);
        }
        else {
            // we haven't found the caller, so just log what we have
            LogRecord logRecord = new LogRecord(level, msg);
            logRecord.setThrown(t);
            logger.log(logRecord);
        }
    }
View Full Code Here

Examples of java.util.logging.LogRecord

                req.setResponse(responseCode, "");
            } else {
                req.setResponse(404, "Destination not found");
            }
        } catch (Exception e) {
            LogRecord r = new LogRecord(Level.SEVERE, "Exception at " + target);
            r.setThrown(e);
            Logger.getLogger(this.getClass().getName()).log(r);
            req.setResponse(500, "Internal error");
        }
    }
View Full Code Here

Examples of java.util.logging.LogRecord

    protected void complain(String msg) {
        Logger.getLogger(this.getClass().getName()).severe(msg);
    }

    protected void complain(String msg, Throwable thrown) {
        LogRecord r = new LogRecord(Level.SEVERE, msg);
        r.setThrown(thrown);
        Logger.getLogger(this.getClass().getName()).log(r);
    }
View Full Code Here

Examples of java.util.logging.LogRecord

        }
    }

    private LogRecord createRecord(java.util.logging.Level level, CharSequence message, Throwable thrown) {
        // millis and thread are filled by the constructor
        LogRecord record = new LogRecord(level, message != null ? message.toString() : null);

        // TODO resource bundle?
        record.setLoggerName(jdkLogger.getName());
        record.setThrown(thrown);
        fillCallerData(CLASS_NAME, record);

        return record;
    }
View Full Code Here

Examples of java.util.logging.LogRecord

      super(target, size, pushLevel);
    }
    public void push() {
      fileHandler.setFormatter(new JbpmFormatter());
      super.push();
      LogRecord emptyLine = new LogRecord(Level.INFO, "");
      emptyLine.setLoggerName("");
      fileHandler.publish(emptyLine);
      LogRecord line = new LogRecord(Level.INFO, "---- END OF TRIGGERED PUSH ---------------------------------------------------");
      line.setLoggerName("");
      fileHandler.publish(line);
      fileHandler.publish(emptyLine);
      fileHandler.publish(emptyLine);
    }
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.