LogDbg

LogDbg is a type-level attribute that specifies which debug messages originating from the agent for that type are to be logged.

By default, LogDbg is an empty list, meaning that no debug messages are logged for a resource type. Users can modify this attribute for a given resource type, to specify the debug severities that they want to enable, which would cause those debug messages to be printed to the log files.

See About logging agent messages for information on the APIs available to log debug messages from agent entry points. These APIs expect a debug severity as a parameter, along with the message to be logged. You can choose different debug severities for messages to provide different logging levels for the agent. When you enable a a particular severity in the LogDbg attribute, agent entry points log corresponding messages.

For example, if you want to log debug messages for the FileOnOff resource type with severity levels DBG_3 and DBG_4, use the hatype commands:

# hatype -modify FileOnOff LogDbg -add DBG_3 DBG_4

# hatype -display FileOnOff -attribute LogDbg

TYPE ATTRIBUTE VALUE

FileOnOff LogDbg DBG_3 DBG_4

The debug messages from the FileOnOff agent with debug severities DBG_3 and DBG_4 get printed to the log files. Debug messages from C++ entry points get printed to the agent log file and from script entry points will get printed to the HAD log file. An example line from the agent log file:

.

.

2003/06/06 11:02:35 VCS DBG_3 V-16-50-0 FileOnOff:f1:monitor:This is a debug message

FileOnOff.C:res_monitor[28]

You can override the LogDbg attribute. For example, for a specific critical resource, this attribute's value can be set to obtain more debug messages for the resource by adding more debug severities than those already set for the resource's type. From the command line, this can be done using the hares command. For example:

# hares -override f1 LogDbg

# hares -modify f1 LogDbg -add DBG_5

# hares -display f1 -attribute LogDbg

Resource Attribute System Value

f1 LogDbg global DBG_3 DBG_4 DBG_5

Note that once LogDbg is overridden, you have to use the 'hares' command to display the value of the LogDbg attribute for resource f1. The 'hatype' command will display the value for the entire type.

The FileOnOff agent log would now include debug messages for the f1 resource at severity level DBG_5 in addition to debug messages at the severity levels DBG_3 and DBG_4 enabled for the resource type.

The LogDbg attribute value can be overridden.

Note   Values of LogDbg overridden for a resource are effective only if the agent uses VCSAG_RES_LOG_MSG, the only API that checks if a particular debug severity is enabled for the resource before writing the message to the log file. Refer to Logging agent messages for more information.