Interface LogContextConfiguration


  • public interface LogContextConfiguration
    A log context configuration.
    Author:
    David M. Lloyd
    • Method Detail

      • getLogContext

        LogContext getLogContext()
        Get the log context being configured by this configuration object.
        Returns:
        the log context
      • removeLoggerConfiguration

        boolean removeLoggerConfiguration​(String loggerName)
      • addHandlerConfiguration

        HandlerConfiguration addHandlerConfiguration​(String moduleName,
                                                     String className,
                                                     String handlerName,
                                                     String... constructorProperties)
        Add a handler configuration.
        Parameters:
        moduleName - the module name, or null to use the logmanager's class path
        className - the class name of the handler (must not be null)
        handlerName - the name of the handler (must be unique within this configuration and not null)
        constructorProperties - an optional list of constructor property names
        Returns:
        the new handler configuration
      • removeHandlerConfiguration

        boolean removeHandlerConfiguration​(String handlerName)
        Remove a handler configuration. Also removes handler from everything it was added to.
        Parameters:
        handlerName - the handler name to remove
        Returns:
        true if the handler was removed, false if the handler didn't exist
      • removeFormatterConfiguration

        boolean removeFormatterConfiguration​(String formatterName)
      • getFormatterNames

        List<String> getFormatterNames()
      • removeFilterConfiguration

        boolean removeFilterConfiguration​(String filterName)
      • removeErrorManagerConfiguration

        boolean removeErrorManagerConfiguration​(String errorManagerName)
      • getErrorManagerNames

        List<String> getErrorManagerNames()
      • prepare

        void prepare()
        Prepares the current changes. The changes are applied into the running logging configuration, but can be rolled back using the forget() method if commit() has not been invoked.
      • addPojoConfiguration

        PojoConfiguration addPojoConfiguration​(String moduleName,
                                               String className,
                                               String pojoName,
                                               String... constructorProperties)
        Add a POJO configuration.
        Parameters:
        moduleName - the module name, or null to use the logmanager's class path
        className - the class name of the POJO (must not be null)
        pojoName - the name of the POJO (must be unique within this configuration and not null
        constructorProperties - an optional list of constructor property names
        Returns:
        the new handler configuration
      • removePojoConfiguration

        boolean removePojoConfiguration​(String pojoName)
        Removes the POJO configuration.
        Parameters:
        pojoName - the name of the POJO
        Returns:
        true if the configuration was removed, othwerwise false if the configuration did not exist or was not remove.
      • getPojoConfiguration

        PojoConfiguration getPojoConfiguration​(String pojoName)
        Gets the POJO configuration.
        Parameters:
        pojoName - the name of the POJO
        Returns:
        the POJO configuration if found, otherwise null
      • getPojoNames

        List<String> getPojoNames()
        A list of the POJO configuration names.
        Returns:
        a list of the names
      • commit

        void commit()
        Commit the current changes into the running logging configuration.
      • forget

        void forget()
        Clear all the current changes and restore this object to its original state.