Class Log4JHierarchyInit

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class Log4JHierarchyInit
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware
    Initialises Log4j's HierarchyDynamicMBean (refer to core-services-context.xml) and any overriding log4.properties files. The actual implementation uses introspection to avoid any hard-coded references to Log4J classes. If Log4J is not present, this class will do nothing.

    Alfresco modules can provide their own log4j.properties file, which augments/overrides the global log4j.properties within the Alfresco webapp. Within the module's source tree, suppose you create:

          config/alfresco/module/{module.id}/log4j.properties
     
    At deployment time, this log4j.properties file will be placed in:
          WEB-INF/classes/alfresco/module/{module.id}/log4j.properties
     
    Where {module.id} is whatever value is set within the AMP's module.properties file. For details, see: Developing an Alfresco Module

    For example, if {module.id} is "org.alfresco.module.someModule", then within your source code you'll have:

     config / alfresco / module / org.alfresco.module.someModule / log4j.properties
     
    This would be deployed to:
     WEB - INF / classes / alfresco / module / org.alfresco.module.someModule / log4j.properties
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init()  
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
      void setExtraLog4jUrls​(java.util.List<java.lang.String> urls)
      Loads a set of augmenting/overriding log4j.properties files from locations specified via an array of Srping URLS.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Log4JHierarchyInit

        public Log4JHierarchyInit()
    • Method Detail

      • setExtraLog4jUrls

        public void setExtraLog4jUrls​(java.util.List<java.lang.String> urls)
        Loads a set of augmenting/overriding log4j.properties files from locations specified via an array of Srping URLS.

        This function supports Spring's syntax for retrieving multiple class path resources with the same name, via the "classpath*:" prefix. For details, see: PathMatchingResourcePatternResolver.

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • init

        public void init()