ScopeType

public final class ScopeType implements LoggingScopeProvider

Singleton keys which identify different types of scopes which scoped contexts can be bound to.

To bind a context to a scope type, create the context with that type:


ScopedLoggingContext.getInstance().newScope(REQUEST).run(() -> someTask(...));

Properties

Link copied to clipboard
public final static ScopeType REQUEST
The built in "request" scope.

Functions

Link copied to clipboard
public static ScopeType create(String name)
Creates a new Scope type, which can be used as a singleton key to identify a scope during scoped context creation or logging.
Link copied to clipboard
@Nullable()
public @Nullable() LoggingScope getCurrentScope()
Returns the current scope (most likely via global or thread local state) or null if there is no current scope.