Disable in-memory logging in catalog log4j.xml file

Document ID : KB000012798
Last Modified Date : 14/02/2018
Show Technical Document Details

In order to achieve the goal of logging low level statements when an error occurs, the developers  need to write a log4j In-Memory Appender and this will keep track of all the log statements in the memory and when an error occurs, it has to dump all the in memory log statements to the log file called error.log.    This slightly increases the performance overhead .  It should be disabled on the catalog PRODUCTION environment  


How to disable in-memory logging in catalog log4j.xml file ?  

service catalog 12.8 , 12.9 , 14.1

1.  go to USM_HOME\view\conf\ folder   on catalog server ,  locate log4j.xml file .    Make a backup copy of this log4j.xml file  first 

2.  open and edit this  log4j.xml file ,  delete or comment out the following memory related two sections : 

 <appender name="memory" class="com.ca.usm.util.log.MemoryAppender">
    <param name="File" value="${usm.home}/logs/error.log" />
    <param name="MaxFileSize" value="10MB" />
    <param name="MaxBackupIndex" value="10" />
    <param name="MaxMemoryLogs" value="50000" /> <!-- Event logs count, default 50,000-->
    <param name="MaxMemoryTime" value="600000" /> <!-- Time in milliseconds, default 10 minutes -->
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d{yyyy/MM/dd HH.mm.ss.SSS} %-5p [%X{UNIQUEID}] [%t] [%c{1}] %m%n" />
   <logger name="com.ca.usm">
    <level value="ALL" />
    <appender-ref ref="memory" />

3.  save it . 


Note :

1. There is no need to recycle service catalog to have this change .  It can be take effect on the fly . 

2.  The simplest way is to just delete those two sections mentioned above .  If you want to comment out those two  sections , please be careful with xml file syntax :  in  the first section ,  please note it  already has comment lines inside that section:

 <!-- Event logs count, default 50,000--> 

 <!-- Time in milliseconds, default 10 minutes -->

 you will need to delete those comment lines inside it first and then comment out that section.