< Previous | Next > | |
Product: Cluster Server Guides | |
Manual: Cluster Server 4.1 Agent Developer's Guide |
Logging in C++ and Script-based Entry PointsFor VCS 4.0, developers creating C++ agent entry points can use a set of macros to log application or debug messages. Developers of script-based entry points can use a set of functions, or "wrappers," that call the VCS halog utility to generate application or debug messages. VCS Agent Messages: FormatAn agent log message consists of five fields. The format of the message is: <Timestamp> <Mnemonic> <Severity> <UMI> <MessageText> The following is an example message, of severity ERROR, generated by the VCS FileOnOff agent's online entry point when attempting to online the resource, a file named "MyFile": Jun 26 2003 11:32:56 VCS ERROR V-16-2001-14001 FileOnOff:MyFile:online:Resource could not be brought up because, the attempt to create the file (/tmp/MyFile) failed with error (Is a Directory) The first four fields of the message above is composed of the timestamp, an uppercase mnemonic that represents the product (VCS, in this case), the severity, and the UMI (unique message ID). The subsequent lines contain the message text. TimestampThe timestamp indicates when the message was generated. It is formatted according to the locale. MnemonicThe mnemonic field is used to indicate the product. The mnemonic, such as "VCS," must use all capital letters. All VCS bundled agents, enterprise agents, and custom agents use the mnemonic: "VCS." SeverityThe severity of each message is displayed in the third field of the message (Critical, Error, Warning, Notice, or Information for normal messages; 1-21 for debug messages). All C++ logging macros and script-based logging functions provide a means to define the severity of messages, both normal and debugging. UMIThe UMI (unique message identifier) includes an originator ID, a category ID, and a message ID.
Message TextThe message text is a formatted message string preceded by a dynamically generated header consisting of three colon-separated fields. namely, <name of the agent>:<resource>:<name of the entry point>:<message>. For example: FileOnOff:MyFile:online:Resource could not be brought up because, the attempt to create the file (/tmp/MyFile) failed with error (Is a Directory) In the case of C++ entry points, the header information is generated In the case of script-based entry points, the header information is set within the VCSAG_SET_ENVS function (see VCSAG_SET_ENVS). |
^ Return to Top | < Previous | Next > |
Product: Cluster Server Guides | |
Manual: Cluster Server 4.1 Agent Developer's Guide | |
VERITAS Software Corporation
www.veritas.com |