Class StackTraceStringResolver
- java.lang.Object
-
- org.apache.logging.log4j.layout.template.json.resolver.StackTraceStringResolver
-
- All Implemented Interfaces:
StackTraceResolver,TemplateResolver<java.lang.Throwable>
final class StackTraceStringResolver extends java.lang.Object implements StackTraceResolver
Exception stack trace to JSON string resolver used byExceptionResolver.
-
-
Field Summary
Fields Modifier and Type Field Description private Recycler<TruncatingBufferedPrintWriter>dstWriterRecyclerprivate java.util.List<java.util.regex.Pattern>groupedTruncationPointMatcherRegexesprivate Recycler<CharSequencePointer>sequencePointerRecyclerprivate Recycler<TruncatingBufferedPrintWriter>srcWriterRecyclerprivate booleantruncationEnabledprivate java.util.List<java.lang.String>truncationPointMatcherStringsprivate java.lang.StringtruncationSuffix
-
Constructor Summary
Constructors Constructor Description StackTraceStringResolver(EventResolverContext context, java.lang.String truncationSuffix, java.util.List<java.lang.String> truncationPointMatcherStrings, java.util.List<java.lang.String> truncationPointMatcherRegexes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intfindLabeledLineStartIndex(java.lang.CharSequence buffer, int startIndex, int endIndex)private static intfindLineStartIndex(java.lang.CharSequence buffer, int startIndex, int endIndex)private static intfindMatchingIndex(java.lang.CharSequence matcher, java.lang.CharSequence buffer, int bufferStartIndex, int bufferEndIndex)private intfindTruncationPointIndex(TruncatingBufferedPrintWriter writer, int startIndex, int endIndex, CharSequencePointer sequencePointer)private static java.util.List<java.util.regex.Pattern>groupTruncationPointMatcherRegexes(java.util.List<java.lang.String> regexes)voidresolve(java.lang.Throwable throwable, JsonWriter jsonWriter)Resolves the givenvalueusing the providedJsonWriter.private TruncatingBufferedPrintWritertruncate(TruncatingBufferedPrintWriter srcWriter)private voidtruncate(TruncatingBufferedPrintWriter srcWriter, TruncatingBufferedPrintWriter dstWriter, CharSequencePointer sequencePointer)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.layout.template.json.resolver.TemplateResolver
isFlattening, isResolvable, isResolvable, resolve
-
-
-
-
Field Detail
-
srcWriterRecycler
private final Recycler<TruncatingBufferedPrintWriter> srcWriterRecycler
-
dstWriterRecycler
private final Recycler<TruncatingBufferedPrintWriter> dstWriterRecycler
-
sequencePointerRecycler
private final Recycler<CharSequencePointer> sequencePointerRecycler
-
truncationEnabled
private final boolean truncationEnabled
-
truncationSuffix
private final java.lang.String truncationSuffix
-
truncationPointMatcherStrings
private final java.util.List<java.lang.String> truncationPointMatcherStrings
-
groupedTruncationPointMatcherRegexes
private final java.util.List<java.util.regex.Pattern> groupedTruncationPointMatcherRegexes
-
-
Constructor Detail
-
StackTraceStringResolver
StackTraceStringResolver(EventResolverContext context, java.lang.String truncationSuffix, java.util.List<java.lang.String> truncationPointMatcherStrings, java.util.List<java.lang.String> truncationPointMatcherRegexes)
-
-
Method Detail
-
groupTruncationPointMatcherRegexes
private static java.util.List<java.util.regex.Pattern> groupTruncationPointMatcherRegexes(java.util.List<java.lang.String> regexes)
-
resolve
public void resolve(java.lang.Throwable throwable, JsonWriter jsonWriter)Description copied from interface:TemplateResolverResolves the givenvalueusing the providedJsonWriter.- Specified by:
resolvein interfaceTemplateResolver<java.lang.Throwable>
-
truncate
private TruncatingBufferedPrintWriter truncate(TruncatingBufferedPrintWriter srcWriter)
-
truncate
private void truncate(TruncatingBufferedPrintWriter srcWriter, TruncatingBufferedPrintWriter dstWriter, CharSequencePointer sequencePointer)
-
findTruncationPointIndex
private int findTruncationPointIndex(TruncatingBufferedPrintWriter writer, int startIndex, int endIndex, CharSequencePointer sequencePointer)
-
findLabeledLineStartIndex
private static int findLabeledLineStartIndex(java.lang.CharSequence buffer, int startIndex, int endIndex)
-
findLineStartIndex
private static int findLineStartIndex(java.lang.CharSequence buffer, int startIndex, int endIndex)
-
findMatchingIndex
private static int findMatchingIndex(java.lang.CharSequence matcher, java.lang.CharSequence buffer, int bufferStartIndex, int bufferEndIndex)
-
-