Class ContextClassLoaderLogContextSelector

  • All Implemented Interfaces:
    LogContextSelector

    public final class ContextClassLoaderLogContextSelector
    extends Object
    implements LogContextSelector
    A log context selector which chooses a log context based on the thread context classloader.
    • Constructor Detail

      • ContextClassLoaderLogContextSelector

        public ContextClassLoaderLogContextSelector​(LogContextSelector defaultSelector)
        Construct a new instance. If no matching log context is found, the provided default selector is consulted.
        Parameters:
        defaultSelector - the selector to consult if no matching log context is found
      • ContextClassLoaderLogContextSelector

        public ContextClassLoaderLogContextSelector()
        Construct a new instance. If no matching log context is found, the system context is used.
    • Method Detail

      • unregisterLogContext

        public boolean unregisterLogContext​(ClassLoader classLoader,
                                            LogContext logContext)
        Unregister a class loader/log context association. This method requires the unregisterLogContext RuntimePermission.
        Parameters:
        classLoader - the classloader
        logContext - the log context
        Returns:
        true if the association exists and was removed, false otherwise