6.5 Changing the Default Logging Configuration

The following log settings in the owcimomd.conf file let you specify where and how much logging occurs, the type of errors logged, and the log size, filename, and format:

If you want to set up debug logging, see Section 6.6, Configuring Debug Logging.

If you want to set up additional logs, see Section 6.7, Configuring Additional Logs.

6.5.1 log.main.categories

Purpose

Specifies the categories the log outputs.

Syntax

log.main.categories = option

Option

Use

category_name

Specifies the categories to be logged using a space delimited list.

The categories used in OWCIMOMD are:

  • DEBUG

  • ERROR

  • FATAL

  • INFO

For more information about these options, see log.main.level.

If specified in this option, the predefined categories are not treated as levels, but as independent categories. No default is available; if a category is not set, no categories are logged and the log.main.level setting is used.

*

All categories are logged.

This is the default setting.

Example

log.main.categories = FATAL ERROR INFO

6.5.2 log.main.components

Purpose

Specifies the components that the log outputs.

Syntax

log.main.components = option

Option

Use

component_name

Specifies the components to be logged (such as OWCIMOMD) using a space-‑delimited list.

Providers can use their own components.

*

Specifies that all components are logged.

This is the default setting.

Example

log.main.components = owcimomd nssd

6.5.3 log.main.format

Purpose

Specifies the format (text mixed with printf() style conversion specifiers) of the log messages.

Syntax

log.main.format = conversion_specifier

Option

Specifies

%%

%

%c

Component (such as OWCIMOMD)

%d

Date

Can be followed by a date format specifier enclosed between braces. For example, %d{%H:%M:%S} or %d{%d %b %Y %H:%M:%S}. If no date format specifier is given, then ISO 8601 format is assumed.

The only addition is %Q, which is the number of milliseconds.

For more information about the date format specifiers, see the documentation for the strftime() function found in the <ctime> header.

%e

Message as XML CDATA. This includes the “<![CDATA[“ and ending “] ]>”

%F

Filename

%l

Filename and line number. For example, file.cpp(100)

%L

Line number

%M

Method name where the logging request was issued (only works on C++ compilers that support __PRETTY_FUNCTION__ or C99’s __func__).

%m

Message

%n

Platform-dependent line separator character (\n) or characters (\r\n).

%p

Category, also known as level or priority.

%r

Number of milliseconds elapsed between the start of the application and the creation of the logging event.

%t

Thread ID

\n

New line

\t

Tab

\r

Line feed

\\

\

\x<hexDigits>

Character represented in hexadecimal

It is possible to change the minimum field width, the maximum field width, and justification. The optional format modifier is placed between the percent sign (%) and the conversion character. The first optional format modifier is the left justification flag, which is the minus (-) character. The optional minimum field width modifier follows, which is an integer that represents the minimum number of characters to output. If the data item requires fewer characters, it is padded with spaces on either the left or the right, according to the justification flag. If the data item is larger than the minimum field width, the field is expanded to accommodate the data.

The maximum field width modifier is designated by a period (.) followed by a decimal constant. If the data item is longer than the maximum field, then the extra characters are removed from the beginning of the data item (by default) or from the end (if the left justification flag was specified).

Examples

Log4j TTCC layout:

"%r [%t] %-5p %c - %m"

Similar to TTCC but with some fixed-size fields:

"%-6r [%15.15t] %-5p %30.30c - %m"

XML output conforming to log4j.dtd 1.2, which can be processed by Chainsaw (if used, this must be on one line; it is split up here for readability):

"<log4j:event logger="%c" timestamp="%d{%s%Q}" level="%p" thread="%t"> <log4j:message>%e</log4j:message> <log4j:locationInfo class="" method="" file="%F" line="%L"/></log4j:event>"

The following is the default:

log.main.format = [%t]%m

6.5.4 log.main.level

Purpose

Specifies the level the log outputs. If set, the log outputs all predefined categories at and above the specified level.

Syntax

log.main.level = option

Option

Use

DEBUG

Logs all Debug, Info, Error, and Fatal error messages.

ERROR

Logs all Error and Fatal error messages.

This is the default setting.

FATAL

Logs only Fatal error messages.

INFO

Logs all Info, Error, and Fatal error messages.

Example

log.main. level = ERROR

6.5.5 log.main.location

Purpose

Specifies the location of the log file OWCIMOMD uses when the log.main.type setting option specifies that logging is sent to a file.

Syntax

log.main.location = path_filename

Example

log.main.location = /system/cimom/var/owcimomd.log

6.5.6 log.main.max_backup_index

Purpose

Specifies the amount of backup logs that are kept before the oldest is erased.

Syntax

log.main.backup_index = option

Option

Use

unsigned_integer_above_0

Specifies the number of backup logs kept.

The default setting is 1 log file.

0

No backup logs are made and the log is truncated when it reaches the maximum file size.

Example

log.main.max_backup_index = 1

6.5.7 log.main.max_file_size

Purpose

Specifies the maximum size (in KB) that the OWCIMOMD log can grow to.

Syntax

log.main.max_file_size = option

Option

Use

unsigned _integer_in_KB

Limits the log to a certain size in KB.

0

Lets the log grow to an unlimited size.

This is the default setting.

Example

log.main.max_file_size = 0

6.5.8 log.main.type

Purpose

Specifies the type of main log OWCIMOMD uses.

Syntax

log.main.type = option

Option

Use

file

Sends all messages to a file that is identified in the log.main.location configuration setting.

null

Disables logging.

syslog

Sends all messages to the syslog interface.

This is the default setting for Linux.

Example

log.main.type = syslog