Class StackHashJsonProvider

All Implemented Interfaces:
ContextAware, JsonProvider<ILoggingEvent>

public class StackHashJsonProvider extends AbstractFieldJsonProvider<ILoggingEvent>
A JSON provider that adds a stack_hash Json field on a log with a stack trace

This hash is computed using StackHasher

Author:
Pierre Smeyers
  • Field Details

  • Constructor Details

    • StackHashJsonProvider

      public StackHashJsonProvider()
  • Method Details

    • start

      public void start()
      Description copied from interface: JsonProvider
      Start the provider after all configuration properties are set.
      Specified by:
      start in interface JsonProvider<ILoggingEvent>
      Overrides:
      start in class AbstractJsonProvider<ILoggingEvent>
    • stop

      public void stop()
      Description copied from interface: JsonProvider
      Stop the provider
      Specified by:
      stop in interface JsonProvider<ILoggingEvent>
      Overrides:
      stop in class AbstractJsonProvider<ILoggingEvent>
    • addExclude

      public void addExclude(String exclusionPattern)
    • addExclusions

      public void addExclusions(String commaSeparatedPatterns)
      Add multiple exclusion patterns as a list of comma separated patterns
      Parameters:
      commaSeparatedPatterns - list of comma separated patterns
    • setExcludes

      public void setExcludes(List<String> exclusionPatterns)
    • getExcludes

      public List<String> getExcludes()
    • writeTo

      public void writeTo(JsonGenerator generator, ILoggingEvent event) throws IOException
      Description copied from interface: JsonProvider
      Writes information about the event, to the given generator.

      When called, the generator is assumed to be within a JSON object context (i.e. this provider should write fields and their values to the generator). Upon return, the generator should be within the same JSON object context.

      Parameters:
      generator - the JsonGenerator to produce JSON content
      event - the event to convert into JSON
      Throws:
      IOException - if an I/O error occurs