Examples of LogItem


Examples of com.firefly.utils.log.LogItem

    this.name = name;
  }

  private void add(String str, String level, Throwable throwable,
      Object... objs) {
    LogItem item = new LogItem();
    item.setLevel(level);
    item.setName(name);
    item.setDate(SafeSimpleDateFormat.defaultDateFormat.format(new Date()));
    String content = StringUtils.replace(str, objs);
    if (throwable != null) {
      StringBuilder strBuilder = new StringBuilder();
      strBuilder.append(CL);
      for (StackTraceElement ele : throwable.getStackTrace()) {
        strBuilder.append(ele).append(CL);
      }
      content += strBuilder.toString();
    }
    item.setContent(content);
    if (consoleOutput)
      System.out.println(item.toString());
    if (fileOutput)
      LogFactory.getInstance().getLogTask().add(item);
  }
View Full Code Here

Examples of com.firefly.utils.log.LogItem

    this.name = name;
  }

  private void add(String str, String level, Throwable throwable,
      Object... objs) {
    LogItem item = new LogItem();
    item.setLevel(level);
    item.setName(name);
    item.setContent(str);
    item.setObjs(objs);
    item.setThrowable(throwable);
    if (consoleOutput)
      System.out.println(item.toString());
    if (fileOutput)
      LogFactory.getInstance().getLogTask().add(item);
  }
View Full Code Here

Examples of com.firefly.utils.log.LogItem

    this.name = name;
  }

  private void add(String str, String level, Throwable throwable,
      Object... objs) {
    LogItem item = new LogItem();
    item.setLevel(level);
    item.setName(name);
    item.setContent(str);
    item.setObjs(objs);
    item.setThrowable(throwable);
    if (consoleOutput) {
      item.setDate(SafeSimpleDateFormat.defaultDateFormat.format(new Date()));
      System.out.println(item.toString());
    }
    if (fileOutput)
      LogFactory.getInstance().getLogTask().add(item);
  }
View Full Code Here

Examples of com.persistit.logging.PersistitLogMessage.LogItem

            if (annotation != null) {
                try {
                    final String[] v = annotation.value().split("\\|");
                    final PersistitLevel level = PersistitLevel.valueOf(v[0]);
                    final String message = v[1];
                    final LogItem logItem = (LogItem) field.get(this);
                    logItem.configure(logger, level, message);
                } catch (final Exception e) {
                    System.err.printf("%s on field %s with annotation %s", e, field, annotation);
                }
            }
        }
View Full Code Here

Examples of com.persistit.logging.PersistitLogMessage.LogItem

            if (annotation != null) {
                try {
                    final String[] v = annotation.value().split("\\|");
                    final PersistitLevel level = PersistitLevel.valueOf(v[0]);
                    final String message = v[1];
                    final LogItem logItem = (LogItem) field.get(this);
                    logItem.configure(logger, level, message);
                } catch (final Exception e) {
                    System.err.printf("%s on field %s with annotation %s", e, field, annotation);
                }
            }
        }
View Full Code Here

Examples of com.persistit.logging.PersistitLogMessage.LogItem

            if (annotation != null) {
                try {
                    final String[] v = annotation.value().split("\\|");
                    final PersistitLevel level = PersistitLevel.valueOf(v[0]);
                    final String message = v[1];
                    LogItem logItem = (LogItem) field.get(this);
                    logItem.configure(logger, level, message);
                } catch (Exception e) {
                    System.err.printf("%s on field %s with annotation %s", e, field, annotation);
                }
            }
        }
View Full Code Here

Examples of com.persistit.logging.PersistitLogMessage.LogItem

            if (annotation != null) {
                try {
                    final String[] v = annotation.value().split("\\|");
                    final PersistitLevel level = PersistitLevel.valueOf(v[0]);
                    final String message = v[1];
                    final LogItem logItem = (LogItem) field.get(this);
                    logItem.configure(logger, level, message);
                } catch (final Exception e) {
                    System.err.printf("%s on field %s with annotation %s", e, field, annotation);
                }
            }
        }
View Full Code Here

Examples of com.sleepycat.je.log.LogItem

                /*
                 * If nothing was written to log for this txn, no need to log a
                 * commit.
                 */
                if (updateLoggedForTxn()) {
                    final LogItem commitItem =
                        logCommitEntry(durability.getLocalSync(),
                                       obsoleteLsns);
                    commitLsn = commitItem.getNewLsn();

                    try {
                        postLogCommitHook(commitItem);
                    } catch (DatabaseException hookException) {
                        if (!propagatePostCommitException(hookException)) {
View Full Code Here

Examples of com.sleepycat.je.log.LogItem

            new SingleItemEntry(LogEntryType.LOG_TXN_COMMIT,
                                new TxnCommit(id,
                                              lastLoggedLsn,
                                              getReplicatorNodeId()));

        LogItem item = new LogItem();
        item.entry = commitEntry;
        item.provisional = Provisional.NO;
        item.repContext = repContext;

        LogContext context = new LogContext();
View Full Code Here

Examples of com.sleepycat.je.log.LogItem

    void put(VLSN vlsn, LogItem logItem) {
        getArray()[(int)vlsn.getSequence() & sizeMask].set(logItem);
    }

    LogItem get(VLSN vlsn) {
        final LogItem item =
            getArray()[(int)vlsn.getSequence() & sizeMask].get();
        if ((item != null) && item.getHeader().getVLSN().equals(vlsn)) {
            nHits.increment();
            return item;
        }

        nMisses.increment();
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.