Package java.util.logging

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


      });
      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

                    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

                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

    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

        }
    }

    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

      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

        }
        for (JGDIBaseImpl jgdi : currentInstances) {
            try {
                jgdi.close();
            } catch (JGDIException ex) {
                LogRecord lr = new LogRecord(Level.FINE, "close of connection {0} failed");
                lr.setParameters(new Object[]{jgdi.ctxIndex});
                lr.setThrown(ex);
                log.log(lr);
            }
        }
    }
View Full Code Here

                Signature s = Signature.getInstance(algorithm);
                s.initVerify(chain[0]);
                s.update(message);
                return s.verify(signature);
            } catch (Exception ex) {
                LogRecord lr = new LogRecord(Level.WARNING, "Error while verifing message of user {0}");
                lr.setParameters(new Object[]{username});
                lr.setThrown(ex);
                log.log(lr);
                return false;
            }
        }
    }   
View Full Code Here

                        } catch (IOException ex) {
                        // Ignore
                        }
                    }               
                } catch(Exception ex) {
                    LogRecord lr = new LogRecord(Level.WARNING, "Error while reading certificate from file {0}");
                    lr.setParameters(new Object[]{certFile});
                    lr.setThrown(ex);
                    log.log(lr);
                    cert = null;
                }
            }
            return cert;
View Full Code Here

TOP

Related Classes of java.util.logging.LogRecord

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.