LogFormatEntry
LogFormatEntry formats a Log Entry for display.
Syntax
LogFormatEntry(service, pFormatEntry)
Parameters
- service (ULONG) - input
- The class of Logging Service:
- Error logging
- All other values are reserved for future use.
- pFormatEntry (PVOID) - input
- A pointer to the LogFormatEntry parameter packet.
- For Error Logging, this is a pointer to a LFEREQUEST structure.
Returns
- rc (APIRET) - returns
- Return code.
- LogFormatEntry returns the following values:
- No error
- 2 Error file not found
- 520 Error LF buf too small
- 523 Error LF invalid service
- 524 Error LF general failure
- 1703 Invalid data pointer
- 1701 Invalid LF log file id
- 1702 Invalid LF packet revision number
- 1706 Invalid LF parm packet ptr
- 1751 Invalid LF flag
- 1761 Error LF invalid packet size
- 1770 Invalid log entry record
- 1771 No log entry format template available
- 2507 RAS unicode conversion error
- 2600 RAS invalid locale object
Remarks
ADDITIONAL RETURNS INFORMATION
The data will be passed back in multiple occurrences of the following LTD (Length, Type, Data) format:
ULONG length ULONG type UniChar data[n] or Char data[n]
Where:
- length (ULONG) is the length, in bytes, of this detail record (includes length, type, and data fields).
- type (ULONG) is an integer value that represents the type of data being passed back.
An error record is created by the system when an error in a system or application program triggers a probe in that program. Error records contain detailed information to help you diagnose the error. Error records are also called DET1 records. Records created by a back level logging system are called DET4 records.
A control record is created by the system when you make changes to the way errors are logged. For example, when you suspend error logging or direct error logging to a new file, the system records that change in a control record. Control records are also called DET2 records. Control records are new for FFST technology and are not available in records created by a back level logging system.
The following are the current Error Logging type values and their meanings:
Type | Meaning | From Record Type |
---|---|---|
0005 | Date heading | DET1, DET2, or DET4 record |
0006 | Date | DET1, DET2, or DET4 record |
0007 | Time heading | DET1, DET2, or DET4 record |
0008 | Time | DET1, DET2, or DET4 record |
0009 | Entry ID heading | DET1, DET2, or DET4 record |
0010 | Entry ID | DET1, DET2, or DET4 record |
0011 | Severity heading | DET1 record |
0012 | Severity | DET1 record |
0013 | Module name heading | DET1 record |
0014 | Module name | DET1 record |
0015 | Directory name heading | DET1 record |
0016 | Directory name | DET1 record |
0017 | Error message heading | DET1 record |
0018 | Error message text | DET1 record |
0019 | Probe ID heading | DET1 record |
0020 | Probe ID text | DET1 record |
0021 | Probe Flags heading | DET1 record |
0022 | Probe Flags | DET1 record |
0023 | Template Repository pathname heading | DET1 record |
0024 | Template Repository pathname text | DET1 record |
0025 | Template ID heading | DET1 record |
0026 | Template ID text | DET1 record |
0027 | Dump generated heading | DET1 record |
0028 | Dump Generated text | DET1 record |
0029 | Trace file generated heading | DET1 record |
0030 | Trace File generated text | DET1 record |
0031 | Process dump generated heading | DET1 record |
||0032||Process Dump generated text ||DET1 record ||0040||Failure Causes heading ||DET1 record ³0041||Failure Cause (Could be 4³DET1 ³ ³ ³of these)³record ³0050||Failure Actions heading ³DET1 record ³0051||Failure Action (Could be ³DET1 ³ ³ ³4 of these) ³record ³0060||Install Causes heading ³DET1 record ³0061||Install Cause (Could be 4³DET1 ³ ³ ³of these)³record ³0070||Install Actions heading ³DET1 record ³0071||Install Action (Could be ³DET1 ³ ³ ³4 of these) ³record ³0080||User Causes heading ³DET1 record ³0081||User Cause (Could be 4 of³DET1 ³ ³ ³these)³record ³0090||User Actions heading³DET1 record ³0091||User Action (Could be 4 ³DET1 ³ ³ ³of these)³record ³0100||Return Code heading||DET1 record ³0101||Return Code text ³DET1 record ³0110||Dump File name heading ³DET1 record ³0111||Dump File name text||DET1 record ³0112||Dump formatter heading ³DET1 record ³0113||Dump Formatter text||DET1 record ³0114||Dump File Deletion Date ³DET1 ³ ³ ³heading³record ³0115||Dump File Deletion Date ³DET1 record ³0116||Dump File Deletion Time heading ³DET1 record ³0117||Dump File Deletion Time ³DET1 record ³0120||Trace File name heading ³DET1 record ³0121||Trace File name text³DET1 record ³0122||Trace formatter heading ³DET1 record ³0123||Trace formatter text³DET1 record ³0124||Trace File Deletion Date heading³DET1 record ³0125||Trace File Deletion Date ³DET1 record ³0126||Trace File Deletion Time heading³DET1 record ³0127||Trace File Deletion Time ³DET1 record ³0130||Process Dump File name heading³DET1 record ³0131||Process Dump File name text ³DET1 record ³0132||Process Dump formatter heading³DET1 record ³0133||Process Dump formatter text ³DET1 record ³0134||Process Dump Deletion heading³DET1 ³ ³ ³Date record ³0135||Process Dump File Deletion Date³DET1 record ³0136||Process Dump Deletion Time heading³DET1 record ³0137||Process Dump File Deletion Time³DET1 record ³0140||PCT heading³DET1 record ³0141||PCT Execution Parameters ³DET1 record ³0150||DMI vendor tag heading ³DET1 record ³0151||DMI vendor tag text ³DET1 record ³0155||DMI tag heading ³DET1 record ³0156||DMI tag text³DET1 record ³0165||DMI product ID heading ³DET1 record ³0166||DMI product ID text ³DET1 record ³0170||DMI revision heading³DET1 record ³0171||DMI revision text³DET1 record ³0172||DMI modification level ³DET1 ³heading³record ³0173||DMI modification level text ³DET1 record ³0174||DMI fix level heading ³DET1 record ³0175||DMI fix level text ³DET1 record ³0195||Machine type heading³DET1 record ³0196||Machine type text³DET1 record ³0200||Machine serial number heading³DET1 record ³0201||Machine serial number text ³DET1 record ³0205||Hostname heading ³DET1 record ³0206||Hostname text ³DET1 record ³0210||User Data heading³DET1 record ³0211||User data text ³DET1 record ³0213||Action heading ³DET2 record ³0214||Action text³DET2 record ³0215||Old Value heading³DET2 record ³0216||Old Value text ³DET2 record ³0220||New Value heading³DET2 record ³0221||New Value text ³DET2 record ³0222||Created by backlevel text³DET4 record ³0223||Record ID heading³DET4 record ³0224||Record ID³DET4 record ³0225||Qualifier heading³DET4 record ³0226||Qualifier³DET4 record ³0227||Originator heading||DET4 record ³0228||Originator³DET4 record ³0229||User data³DET4 record ³0230||Process name heading³DET4 record ³0231||Process name³DET4 record ³0232||FMTDLL heading ³DET4 record ³0233||FMTDLL name³DET4 record ³0234||FMTDLL text³DET4 record ³0235||GA component ID heading³DET4 record ³0236||GA component ID ³DET4 record ³0237||GA release level heading ³DET4 record ³0238||GA release level ³DET4 record ³0239||GA software name heading ³DET4 record ³0240||GA software name ³DET4 record ³0241||Generic alert subvector heading³DET4 record ³0242||Generic alert subvector text ³DET4 record ³0243||Probable causes subvector heading³DET4 ³record ³0244||Probable causes subvector text³DET4 record ³0245||User causes subvector heading ³DET4 record ³0246||Install causes subvector heading³DET4 record ³0247||Failure causes subvector heading³DET4 record ³0248||Subvector key heading ³DET4 record ³0249||Subvector key type ³DET4 record ³0250||Subvector key text ³DET4 record ³0251||Hex dump text ³DET4 record
data (UniChar[]) or data (Char[]) is a variable length area that contains the formatted data.
Note: If there is no data, only the length and type portion of the record will be returned. The length would indicate that there is no data.
The library LFAPI.LIB must be linked with object files that use LogFormatEntry
The packet_revision_number parameter defines if pointers point to ASCII or UniCode character data.
Example Code
#define INCL_LOGGING #include <os2.h> #include <lfdef.h> ULONG service; PVOID pFormatEntry; APIRET rc; rc = LogFormatEntry(service, pFormatEntry);
The following example formats an Error Log record for display. The calling program has placed the address of the locale object in locale.
#define INCL_LOGGING #include <unidef.h> #include <os2.h> #include <stdio.h> #include <lfdef.h> { APIRET rc; /* return code */ ULONG service; LFEREQUEST format_entry_packet; BYTE log_entry_buffer[1024]; UniChar string_buffer[4096]; #define STRING_BUFFER_LENGTH 4096 ULONG string_buffer_length; LocaleObject locale; service = ERROR_LOGGING_SERVICE; string_buffer_length = STRING_BUFFER_LENGTH; rc = UniCreateLocaleObject(UNLUCS_STRING_POINTNER,(UniChar *) L"",&locale); if (rc |= 0) { printf("UniCreateLocaleObject error: return code = %d",rc); return; } /* Construct the Error Log Service format packet */ format_entry.packet.packet_size = sizeof(LFEREQUEST); format_entry_packet.packet_revision_number = WPOS_RELEASE_1; format_entry_packet.log_entry_buffer = &log_entry_buffer; format_entry_packet.flags = ERR_FORMAT_DETAIL_DATA; format_entry_packet.locale_object = locale; format_entry_packet.string_buffer_length = &string_buffer_length; format_entry_packet.string_buffer = &string_buffer; rc = LogFormatEntry(service, /* service */ &format_entry_packet) /* parameter packet */ if (rc |= 0) { printf("LogFormatEntry error: return code = %d",rc); return; }