Class LogManagerService

  • All Implemented Interfaces:
    org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, LogManager

    @Service
    @RunLevel(1)
    @Rank(50)
    public class LogManagerService
    extends Object
    implements org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, LogManager
    Reinitialise the log manager using our logging.properties file.
    Author:
    Jerome Dochez, Carla Mott, Naman Mehta
    • Constructor Detail

      • LogManagerService

        public LogManagerService()
    • Method Detail

      • validateProps

        public Map<String,​String> validateProps​(Map<String,​String> props)
        Validates the map of logging properties. Will remove any properties from the map that don't pass the validation, and then throw an exception at the very end.
        Parameters:
        props - the map of properties to validate. WILL BE MODIFIED.
        Returns:
        a map of invalid properties. Will never be null.
      • validateProp

        public void validateProp​(String key,
                                 String value)
        Validates a property. Throws an exception if validation fails.
        Parameters:
        key - the attribute name to validate.
        value - the attribute value to validate.
        Throws:
        jakarta.validation.ValidationException - if validation fails.
      • postConstruct

        public void postConstruct()
        Initialize the loggers
        Specified by:
        postConstruct in interface org.glassfish.hk2.api.PostConstruct
      • listenToChangesOnloggingPropsFile

        public void listenToChangesOnloggingPropsFile​(File loggingPropertiesFile,
                                                      LogManager logMgr)
      • generateAttributeChangeEvent

        public void generateAttributeChangeEvent​(String property,
                                                 String propertyDetail,
                                                 Map props)
      • addHandler

        public void addHandler​(Handler handler)
        Description copied from interface: LogManager
        Adds a new handler to the root logger
        Specified by:
        addHandler in interface LogManager
        Parameters:
        handler - handler to be iadded.
      • preDestroy

        public void preDestroy()
        Specified by:
        preDestroy in interface org.glassfish.hk2.api.PreDestroy