Class DbLogManagerFactory

    • Field Detail

      • detailedProperties

        private final boolean detailedProperties
      • oldPropertyValues

        private final boolean oldPropertyValues
    • Constructor Detail

      • DbLogManagerFactory

        public DbLogManagerFactory()
      • DbLogManagerFactory

        public DbLogManagerFactory​(boolean detailedProperties,
                                   boolean oldValues)
    • Method Detail

      • prepareContext

        public boolean prepareContext​(InvokationContext<? super LogManagerFactory> context)
        Description copied from interface: ActionFactory
        This method is called once for each request/use of an extension and have two purposes:
        • The factory should decide if the extension should be enabled or not. For example, the factory may check the permissions of the logged in user and determine that they are inadequate. The boolean return value determines if the extension is enabled or disabled.
        • Initialise the context with resources that the actions may need. With the BASE web-client this means that it is possible to add scripts or stylesheets that is needed by the extension. See JspContext.
        Specified by:
        prepareContext in interface ActionFactory<LogManagerFactory>
        Parameters:
        context - The current invokation context
        Returns:
        TRUE if the extension should be enabled, FALSE if the extension should be disabled
      • getActions

        public LogManagerFactory[] getActions​(InvokationContext<? super LogManagerFactory> context)
        Description copied from interface: ActionFactory
        This method may be called one or several times for each request. This is decided by the extension point. If, for example, the extension point is a pure single-item extension point then this method is probably only called once. If the extension point is a per-item extension point in a list context, then this method may be called once for every item in the list. The context parameter contains all information about the context of the extension point, including the current item, if any.
        Specified by:
        getActions in interface ActionFactory<LogManagerFactory>
        Parameters:
        context - The current invokation context
        Returns:
        An array of actions that should be added to the extension point. Returns null or an empty array if there are no actions in the current context.
      • getEntityLogger

        public EntityLogger getEntityLogger​(LogManager logManager,
                                            Object entity)
        If a special logger has been registered for the class of the given entity, use that logger, otherwise use the default logger.
        Specified by:
        getEntityLogger in interface LogManagerFactory
        Parameters:
        logManager - The log manager used in the current transaction
        entity - The entity to get a logger for
        Returns:
        An EntityLogger or null if the entity isn't implementing LoggableData
      • setSpecialLogger

        public void setSpecialLogger​(Class<? extends LoggableData> clazz,
                                     EntityLogger logger)
        Register a special logger for entities of the given class.
        Parameters:
        clazz - The class to register a logger for. The class must implement the LoggableData interface
        logger - The logger to use. It must be a thread-safe implementation since it can be used by multiple threads at the same time
      • isLoggingDetailedProperties

        public boolean isLoggingDetailedProperties()
        Should individual log entries for each changed property be created or not?
        Since:
        3.3
      • isLoggingOldPropertyValues

        public boolean isLoggingOldPropertyValues()
        Should log entries with old property values be created or not?
        Since:
        3.3