Class StackHasher

java.lang.Object
net.logstash.logback.stacktrace.StackHasher

public class StackHasher extends Object
Utility class that generates a hash from any Java error
Author:
Pierre Smeyers
  • Constructor Details

  • Method Details

    • hexHash

      public String hexHash(Throwable error)
      Generates a Hexadecimal hash for the given error stack.

      Two errors with the same stack hash are most probably same errors.

      Parameters:
      error - the error to generate a hash from
      Returns:
      the generated hexadecimal hash
    • hexHashes

      public Deque<String> hexHashes(Throwable error)
      Generates and returns Hexadecimal hashes for the error stack and each ancestor cause.

      The first queue element is the stack hash for the topmost error, the next one (if any) is it's direct cause hash, and so on...

      Parameters:
      error - the error to generate a hash from
      Returns:
      a Dequeue with hashes