How to configure asynchronous logging in Liferay

Issue

Environment

  • DXP 7.2
  • DXP 7.3
  • DXP 7.4
  • Quarterly Releases

Resolution

DXP 7.2 and DXP 7.3

NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.

<appender name="ASYNC" class="org.apache.log4j.AsyncAppender" />
...
<root>
...
<appender-ref ref="ASYNC" />
...
</root>
  • For a more detailed example, see the attached DXP 7.2 portal-log4j-ext.xml.

DXP 7.4 and Quarterly Releases

NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.

  • In 7.4 and above, we migrated to version 2.x of log4j.
  • In log4j 2.x, you can deploy a third-party disruptor.jar to gain access to an AsyncLogger that you can configure to make all loggers asynchronous with a system property.
  • See Log4J's 'Asynchronous Loggers for Low-Latency Logging' for detailed instructions.

Additional Information

 

 

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0