Log4j2 Migration Guide - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

This guide serves as a compendium of best practices and tips on how to migrate from Log4j 1.x to Log4j 2.x, in the context of Alfresco Content Services (ACS) and in-process extensions such as custom Alfresco Module Packages (AMPs).

Dependencies

In the context of in-process extensions (for example custom AMPs), it is important that the proper logging dependencies are transitively available via inheritance from the appropriate Alfresco Repository version. It is also ideal to exclude any and all Log4j 1.x / Reload4j dependencies that may be inherited either directly or transitively from any dependency within your project.

Some of the libraries that should be available for logging purposes are:

  • org.apache.logging.log4j:log4j-api
  • org.apache.logging.log4j:log4j-core
  • org.apache.logging.log4j:log4j-slf4j2-impl

Some of the libraries that should not be included instead are:

  • log4j:log4j
  • ch.qos.reload4j:reload4j
  • org.slf4j:slf4j-log4j12
  • org.slf4j:slf4j-reload4j

Note that these lists are subject to change over time. They’re also not fully comprehensive but just serve as an example.