Managing file spaces in USS logs


This topic describes how the space allocation is managed for the USS logs files in Common REST API (CRA) server after installation.

Important

By default, the space allocated to USS log files are CYL(100 50). 

In the cralog4j2.xml log file, which is located in the USS installation directory, you can set a rollover policy to manage functions such as lifecycle, size and deletion for the log files.

Example of a size based rollover policy

Based on the following example of size based rollover policy, every time a file reaches a size of 5 MB, a new file is created up to a maximum of 20 new files. When the 20th file is full, the oldest file is deleted and a new file is created. The maximum logging size is 100 MB.

<RollingFile                                               
        name="CRArollingFile"                               
        fileName="${LOG_FILE}/bmc-common-rest-api.log"      
        filePattern="${LOG_FILE}/bmc-common-rest-api.%i.log"
        ignoreExceptions="false">                           
    <PatternLayout>                                         
        <Pattern>${LOG_PATTERN}</Pattern>                   
    </PatternLayout>                                        
    <Policies>                                              
        <SizeBasedTriggeringPolicy size="5MB" />            
    </Policies>                                             
    <DefaultRolloverStrategy max="20" />                    
</RollingFile>        

Output                                                                                                                              

bmc-common-rest-api.log       File rw-r--r--  fff--- --s- ---- JKS      SSHDG         1     416825

Example of a time based rollover policy

In this example, the maximum number of opsa-audit files is 10, and each day a new file is created regardless of its size:

<RollingFile name="OaRollingFile"                                 
             filePattern="${LOGS_DIR}/opsa-audit%d{yyyy-MM-dd}.log"
             ignoreExceptions="false">                               
    <PatternLayout>                                                  
        <Pattern>%msg%n</Pattern>                                    
    </PatternLayout>                                                 
    <Policies>                                                       
        <OnStartupTriggeringPolicy minSize="0"/>                     
        <TimeBasedTriggeringPolicy interval="1"/>                    
    </Policies>                                                      
    <DirectWriteRolloverStrategy>                                    
        <Delete basePath="${LOGS_DIR}" maxDepth="1">                 
            <IfFileName glob="opsa-audit"/>                        
            <IfAccumulatedFileCount exceeds="10"/>                   
        </Delete>                                                    
    </DirectWriteRolloverStrategy>                                   
</RollingFile>

Output                                         

opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1      87366
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1     218562
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1     186620
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1     126309
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1      26087
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1          0
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1       5889
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1       6041
opsa-audit.2022.log                  File rwxr-xr-x  fff--- -s ---- JKS      SSHDG         1       6661
opsa-audit.2023.log                  File rw-r-r-    fff--- -s ---- JKS      SSHDG         1      16288

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*