Class ErrorLogGenerator

java.lang.Object
com.pnfsoftware.jeb.client.ErrorLogGenerator

public class ErrorLogGenerator extends Object
An error log generator.
  • Field Details

  • Constructor Details

    • ErrorLogGenerator

      public ErrorLogGenerator(Throwable t)
  • Method Details

    • generateUrlencodedThreadsRecordValue

      public static String generateUrlencodedThreadsRecordValue()
    • recordEnginesInformation

      public void recordEnginesInformation(IEnginesContext engctx)
    • getRecords

      public LinkedHashMap<String,String> getRecords()
    • addRecord

      public String addRecord(String key, Object value)
      Add a new record. If a record with a similar key exists, a new key will be generated to insert this record without overwriting the pre-existing value.
      Parameters:
      key - non-null record key
      value - record value
      Returns:
      the actual key that was used to register the record
    • addRecord

      public String addRecord(String key, Object value, boolean generateNewKeyIfExists)
      Add a new record. If a record with a similar key exists, the existing record will not be replaced. It may be added using a different key, or it may not be added at all.
      Parameters:
      key - non-null record key
      value - record value
      generateNewKeyIfExists -
      Returns:
      the actual key that was used to register the record, or null if the record was not inserted
    • setRecord

      public boolean setRecord(String key, Object value)
      Add a new or replace an existing record.
      Parameters:
      key -
      value -
      Returns:
      true if the key did not exist, false if a record having a same key was replaced
    • removeRecord

      public boolean removeRecord(String key)
      Parameters:
      key -
      Returns:
      true if the record was removed
    • getThrowable

      public Throwable getThrowable()
    • getLog

      public String getLog()
      Generate an unencoded string representation of this entire error log.
      Returns:
      the string representation of this log
    • getLog

      public String getLog(Collection<String> keys, boolean encode)
      Generate a string representation of this error log.
      Parameters:
      keys - the keys of records to be generated; use null to mean all; if an ordered collection is provided, the order is maintained
      encode - true to URL-encode the keys and values
      Returns:
      the string representation of this log
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • dumpTo

      public String dumpTo(String folder)
      Dump the unencoded log to a folder on disk.
      Parameters:
      folder -
      Returns:
    • dumpTo

      public String dumpTo(String folder, String filename, boolean encode)
      Dump the log to disk.
      Parameters:
      folder -
      filename - optional; if null, will auto-generate a filename (jeb_errorlog_...)
      encode - true to URL-encode the keys and values
      Returns: