You are here file

Each module can have its own Apache Log4j properties file.

Each module can have its own file, which is placed in the same directory as the file. The collection of files within all modules installed into the alfresco.war act collectively to augment/override the 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:


If you wish to configure Log4j properties in the extensions that aren't packaged as AMP modules, you 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 might 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/licenses 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 Content Services 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 can 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.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.