[Contents] [Prev] [Next] [Index] [Report an Error] [No Frames]


Configuring a Component to Store Log Messages in a File

Use the following statements to configure an SRC component to store log messages in a file:

logger name file { 
    filter filter; 
    filename filename; 
    rollover-filename rollover-filename; 
    maximum-file-size maximum-file-size; 
} 

When you enable logging to a file, by default SRC components and applications write log files in the /opt/UMC/<component-directory>/var/log folder for a component, such as /opt/UMC/sae/var/log.

All log files with the file extension .log in a var/log directory are rotated daily. When a new log file is created, the previous day's file is compressed and saved.

If you plan to filter log messages, you should be familiar with severity levels and filters for logging before you configure system logging for a component. See Chapter 2, Configuring Logging for SRC Components.

To configure component logging to a file:

  1. From configuration mode, access the configuration statement that configures the logging destination for the component.
  2. [edit]
    
    user@host# component-hierarchy logger name file
    
    
    

For example:

[edit]
user@host# edit shared sae configuration logger sae-file-log-1 file 

[edit]
user@host# edit snmp agent logger snmp-file-log-1 file 

[edit]
user@host# edit slot 0 jps logger jps-file-log-1 file 

  1. Specify the filter to define which event messages the software logs or disregards.
  2. [edit shared sae configuration logger sae-file-log-1 file]
    
    user@host# set filter filter 
    
    
    

If you do not specify a filter, logging to the specified file is disabled.

Filters can specify the logging level, such as debug, or can specify expressions.

  1. Specify the absolute path of the filename that contains the current log files.
  2. [edit shared sae configuration logger sae-file-log-1 file]
    
    user@host# set filename filename 
    
    
    

Make sure that the user under which the J2EE application server or Web application server runs has write access to this folder. If this user does not have write access to the default folder, configure the component or application to write logs in folders to which the user has write access.

  1. (Optional)—Solaris platform; not recommended for the C-series platform) Specify the absolute path of the filename that contains the log history.
  2. [edit shared sae configuration logger sae-file-log-1 file]
    
    user@host# set rollover-filename rollover-filename 
    
    
    

When the log file reaches the maximum size, the software closes the log file and renames it with the name you specify for the rollover file. If a previous rollover file exists, the software overwrites it. The software then reopens the log file and continues to save event messages in it.

NOTE: On a C-series platform, log files are automatically rotated on a daily basis. Consider whether specifying a rollover filename is needed for SRC software running on a C-series platform. If you do configure a rollover file when files are rotated, the software creates five compressed versions of partial log files, and one uncompressed log file.


  1. (Optional)—Solaris platform; not recommended for the C-series platform) Specify the maximum size of the log file and the rollover file.
  2. [edit shared sae configuration logger sae-file-log-1 file]
    
    user@host# set maximum-file-size maximum-file-size 
    
    
    

Do not set the maximum file size to a value greater than the available disk space.

NOTE: On a C-series platform, log files are automatically rotated on a daily basis. Typically you do not specify a maximum file size when log files are rotated.



[Contents] [Prev] [Next] [Index] [Report an Error] [No Frames]