Top Fields Constructors Methods
org.keycloak.common.util

public Class StackUtil

extends Object
Class Inheritance
Imports
java.util.concurrent.ConcurrentHashMap, java.util.regex.Pattern, org.jboss.logging.Logger

Author
hmlnarik

Field Summary

Modifier and TypeField and Description
private static final StringBuilder
private static final Pattern
private static final Logger
private static final ConcurrentHashMap<String, Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

If the logger org.keycloak.STACK_TRACE is set to trace level, then returns stack trace, else returns empty StringBuilder
getShortStackTrace
()

Returns string representation of the stack trace of the current call without the call to the getShortStackTrace itself, and ignoring usually irrelevant calls to methods in sun.

public static Object

Returns:

If the logger org.keycloak.STACK_TRACE is set to trace level, then returns stack trace, else returns empty StringBuilder
getShortStackTrace
(final String
Prefix to prepend to every stack trace line
prefix
)

Returns string representation of the stack trace of the current call without the call to the getShortStackTrace itself, and ignoring usually irrelevant calls to methods in sun.

public static boolean
private static Object
stackTraceObject(final String prefix)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
private static final StringBuilder EMPTY
IGNOREDback to summary
private static final Pattern IGNORED
LOGback to summary
private static final Logger LOG
STACK_TRACE_OBJECTSback to summary
private static final ConcurrentHashMap<String, Object> STACK_TRACE_OBJECTS

Constructor Detail

StackUtilback to summary
public StackUtil()

Method Detail

getShortStackTraceback to summary
public static Object getShortStackTrace()

Returns string representation of the stack trace of the current call without the call to the getShortStackTrace itself, and ignoring usually irrelevant calls to methods in sun. and java.lang.reflect packages. The stack trace ignores calls before and including the first org.jboss.resteasy method, hence it usually finishes with the method handling respective REST endpoint. Each line of the stack trace is prepended with "\n ".

Returns:Object

If the logger org.keycloak.STACK_TRACE is set to trace level, then returns stack trace, else returns empty StringBuilder

getShortStackTraceback to summary
public static Object getShortStackTrace(final String prefix)

Returns string representation of the stack trace of the current call without the call to the getShortStackTrace itself, and ignoring usually irrelevant calls to methods in sun. and java.lang.reflect packages. The stack trace ignores calls before and including the first org.jboss.resteasy method, hence it usually finishes with the method handling respective REST endpoint.

Parameters
prefix:String

Prefix to prepend to every stack trace line

Returns:Object

If the logger org.keycloak.STACK_TRACE is set to trace level, then returns stack trace, else returns empty StringBuilder

isShortStackTraceEnabledback to summary
public static boolean isShortStackTraceEnabled()
stackTraceObjectback to summary
private static Object stackTraceObject(final String prefix)