Examples of using vxlogcfg to configure unified logs

Article:HOWTO34327  |  Created: 2010-10-29  |  Updated: 2014-02-25  |  Article URL http://www.symantec.com/docs/HOWTO34327
Article Type
How To




Examples of using vxlogcfg to configure unified logs

Use the vxlogcfg command to change logging levels and rollover settings.

The vxlogcfg command has the following characteristics:

  • The vxlogcfg command is the only way to turn off diagnostic and debug messages in unified logging. In legacy logging, the writing of messages cannot be turned off, only minimized.

  • The vxlogcfg options for robust file logging (MaxLogFileSizeKB and NumberOfLogFiles) also affect certain legacy logs.

    See About limiting the size and the retention of legacy logs

  • Absolute paths must be specified. Do not use relative paths.

The following examples show how to use the vxlogcfg command to configure unified logging settings.

Table: Example uses of the vxlogcfg command



Set the maximum log file size

By default, the maximum log file size in unified logging is 51200 KB. When a log file reaches 51200 KB, the file closes and a new log file opens.

You can change the maximum file size with the MaxLogFileSizeKB option. The following command changes the default maximum log size to 102400 KB for the NetBackup product:

# vxlogcfg -a -p 51216 -o Default -s MaxLogFileSizeKB=102400

For MaxLogFileSizeKB to be effective, the RolloverMode option must be set to FileSize :

# vxlogcfg -a --prodid 51216 --orgid Default -s RolloverMode=FileSize

MaxLogFileSizeKB can be set per originator. An originator that is not configured uses the default value. The following example overrides the default value for service nbrb (originator 118).

# vxlogcfg -a -p 51216 -o nbrb -s MaxLogFileSizeKB=102400

Set log recycling

The following example sets automatic log file deletion for nbemm logs (originator ID 111):

# vxlogcfg -a --prodid 51216 --orgid 111 -s 
    RolloverMode=FileSize -s MaxLogFileSizeKB=102400 -s NumberOfLogFiles=999999 -s LogRecycle=True

This example sets nbemm rollover mode to file size, and turns on log recycling. When the number of log files exceeds 999999, the oldest log file is deleted. EXAMPLE 5 shows how to control the number of log files.

Set the default debug level and diagnostic level

The following example sets the Default  debug level and diagnostic level  to the out of the box settings for product ID NetBackup (51216):

# vxlogcfg -a --prodid 51216 --orgid Default -s DebugLevel=1 -s DiagnosticLevel=6

List the unified logging settings

The following vxlogcfg example shows how to list the active unified logging settings for a given originator (the nbrb service). Note that MaxLogFileSizeKB, NumberOfLogFiles, and RolloverMode are included in the output.

# vxlogcfg -l -o nbrb -p NB
Configuration settings for originator 118, 
    of product 51,216...
LogDirectory = /usr/openv/logs/
DebugLevel = 5
DiagnosticLevel = 5
LogToStdout = False
LogToStderr = False
LogToOslog = False
RolloverMode = FileSize
MaxLogFileSizeKB = 51200
RolloverPeriodInSeconds = 43200
RolloverAtLocalTime = 0:00
NumberOfLogFiles = 4

Control the number of log files

You can use the vxlogmgr command with the vxlogcfg command's NumberOfLogFiles option to manually delete log files.

For example, you currently have 10 unified logging files and the NumberOfLogFiles option is set to 2. Enter the following to keep the two most recent log files and delete the rest for all originators:

# vxlogmgr -a -d

The following command keeps the two most recent log files of all PBX originators:

# vxlogmgr -a -d -p ics

The following deletes log files for the nbrb service only:

# vxlogmgr -a -d -o nbrb

Control disk space usage

Periodically run the vxlogmgr -a command (such as through a cron job) to delete logs and monitor the disk space that unified logging uses.

The disk space that a given originator uses can be calculated as follows:

NumberOfFiles for originator * MaxLogFileSizeKB for originator

The total disk space that unified logs consume is the sum of the disk space that each originator consumes. If none of the originators overrides the NumberOfFiles and MaxLogFileSizeKB settings, then the total disk space that unified logging consumes is as follows:

Number of originators * default MaxLogFileSizeKB * default NumberOfFiles

Use the vxlogcfg command to list the current unified logging settings.

For example, assume the following:

  • vxlogmgr -a -p NB is configured as a cron job with a frequency of one hour.

  • No originators override default settings for MaxLogFileSizeKB or NumberOfFiles.

  • The number of active NetBackup originators on the host is 10. (Typical of a NetBackup master server that is not running BMR or NDMP.)

  • The default MaxLogFileSizeKB is equal to 51200.

  • The default NumberOfFiles is equal to 3.

To calculate the total disk space that unified logging consumes, insert the values from the example into the previous formula. The results are as follows:

10 * 51200 * 3 KB = 153,600 KB of additional disk space used each hour.

See Examples of using vxlogview to view unified logs

See Examples of using vxlogmgr to manage unified logs


Legacy ID


Article URL http://www.symantec.com/docs/HOWTO34327

Terms of use for this information are found in Legal Notices