You are here file

Each module can have its own Log4j properties file.

Each module can have its own file, which is placed in the same directory as The collection of files within all modules installed into the alfresco.war act collectively to augment/override the Alfresco webapp's global WEB-INF/classes/ file.

You can control the logging levels of classes within your module without having to modify the main file; this also allows the logging configuration of a module to be handled cleanly by the Module Management Tool.

Given that {} denotes the value of set in, your file should be put in the following position within the source code directory structure of your module:


At deployment time, this file will be copied to:


For example, if, then in the module's source tree you'll have:


On the servlet container, your module's file will be deployed to:


Your module's file might look something like:

      # webscript module
      #   NOTE
      #   ----
      #      Log4j uses the following logging levels:
      #      debug,info,warn,error,fatal
      #      To set the logging level of {fullClassName} to {loglevel},
      #      add a line to this file of the following form:
      #               log4j.logger.{fullClassName}={loglevel}
      #      For example, to make 'com.example.MyExample' produce 'debug'
      #      logs, add a line like this:
      #   WARNING
      #   -------
      #       Log properties in this file override/augment
      #       those in the webapp's main

Those who wish to configure Log4j properties in Alfresco extensions that aren't packaged as AMP modules can create file of the form: {name} and place it within the alfresco/extension directory on the server's classpath. These properties override the module files. For example:


Finally, developers may also wish to maintain a file outside of the webapp. This allows for changing Log4j settings without touching the "shipping product", or any of a customer's local settings. Your optional file should be in the alfresco/extension directory within the server's classpath, and outside the webapp itself (so you don't accidentally delete it). The file augments/overrides all others. For example:


Best Log4j Configuration Practices

Local customizations/licences are kept outside of the webapp. For example:


Shipping config files should be located within the webapp. For example:


A file should never be used in an ongoing during production, nor packaged as a part of any product.

Advanced Configuration

In the unlikely event that you need to configure the set directories Alfresco uses to find module-specific files, look at WEB-INF/classes/alfresco/core-services-context.xml and find a bean definition fragment that looks something like:

      <property name="overriding_log4j_properties">
          <!-- NOTE: value entries are listed from lowest precedence to highest.  -->
          <!--  Installed  AMP modules  -->
          <!--  Other installed extensions  -->
          <!--  private developer overrides -->

You may add additional path expressions here; for more information on the classpath*: notation used here, see Spring's PathMatchingResourcePatternResolver documentation. Generally this file will not need to be changed.